Lets Learn

Opinion Matters

Posts Tagged ‘Multicast Delegate’

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?

Hint:
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:::)

Advertisements

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

 
%d bloggers like this: