|
From: Andrey S. <as...@gm...> - 2007-10-14 06:03:38
|
On 10/14/07, Steve Mitcham <Ste...@ty...> wrote:
> I see what you are saying with the delegate now. I think that we get
> that into the action by adding an action delegate with no parameters and
> allow an anonymous method to be added perhaps something like
>
> .Will(Cause.Action(new delegate { DoSomething(); }))
>
> And later in 3.5
>
> .Will(Cause.Action(()=> DoSomething();)); // At least I think that would
> be the syntax.
That is cool, but that is one part.
I actually passed the original method parameters to the Action so you
could provide full method implementation. I also passed the return
value back if there was one (in this case delegate was not Action, of
course).
I am attaching code for the Be class to demonstrate the point.
|