Lets Learn

Opinion Matters

Posts Tagged ‘Delegate’

Question 8 # How to get the Return Values from Each Delegate in a Multicast Delegate

Posted by Ankush on March 3, 2011

Lets say you have created a multicast delegate.  You need to be able to access the return value of each delegate that is invoked in the multicast delegate.

How will you do that?


Posted in Questions | Tagged: , , | Leave a Comment »

Question 6: Controlling Delegates and Multicast Delegate

Posted by Ankush on February 23, 2011

You have created a multicast delegate. When you invoke it, each delegate gets fired. You need want more control on this. Basically you want a fine control over:

a. order in which each delegate is invoked

b. firing only a subset of delegates

c. firing each delegate based on the success or failure of previous delegates

How will you achieve this?

A delegate, when called, will invoke all delegatess to read within its invocation list. These delegates are usually invoked sequentially from the first to the last one added.With the use of the GetInvocationList method of the MulticastDelegate class, you can obtain each delegate in the invocation list of a multicast delegate. This method accepts no parameters and returns an array of Delegate objects that corresponds to the invocation list of the delegate on which this method was called.

Now can anybody offer the code solution:::)

Posted in Questions | Tagged: , , | 2 Comments »

%d bloggers like this: