I want to execute a function but before that , I want to verify the password.
I choosed to use the Proxy Design Pattern.
in words :
create the Proxy class,
send the password ,
and tell him WHAT FUNCTION TO EXECUTE if password is ok.
the problem is that According to Proxy Pattern the whole internals should/better be private.
so – I cant see from outside the Method1/2…
and i dont want to make Method1/2 public ( and I dont want If’s) . I want to use delegates.
So , how ( from outside) can I send him a valid Action param ? ( the ac param)
Should I crate to each function a public Action ?

Normally the method that you want to execute should not be part of your proxy class. It’s a method that the caller of this class is passing:
and then you could pass an
Actionas second argument:or if you already have some method defined:
you could:
of if Success was a static method you don’t need an instance of
Foo: