MulticastDelegate

MulticastDelegate CF 1.0, ECMA 1.0, serializable

System (mscorlib.dll) abstract class

This is the base class for multicast delegates. Multicast delegates are identical to normal delegates, except that their invocation list can hold more than one method at a time. You can use Delegate.Combine( ) to add a method to the list and Delegate.Remove( ) to remove one. In C#, you can also use the + operator (or += ) to add methods. When you invoke a multicast delegate, the methods are invoked synchronously one after the other. An error in one method can prevent the delegate from calling the other methods in its list.

Multicast delegates can also be invoked asynchronously, meaning that the entire call chain is invoked serially by a single thread out of the system thread pool. If it is desirable to invoke each delegate in the chain on its own asynchronous thread instead, then use GetInvocationList( ) to obtain the list of delegates and asynchronously invoke each one.

 public abstract class  MulticastDelegate  : Delegate {  // Protected Constructors  protected  MulticastDelegate  (object   target   , string   method   );    protected  MulticastDelegate  (Type   target   , string   method   );  // Public Static Methods  public static bool operator  !=  (MulticastDelegate   d1   , MulticastDelegate   d2   );    public static bool operator  =  =  (MulticastDelegate   d1   , MulticastDelegate   d2   );  // Public Instance Methods  public sealed override bool  Equals  (object   obj   );  // overrides Delegate  public sealed override int  GetHashCode  ( );  // overrides Delegate  public sealed override Delegate[ ]  GetInvocationList  ( );  // overrides Delegate  public override void  GetObjectData  ( System.Runtime.Serialization.SerializationInfo   info   ,         System.Runtime.Serialization.StreamingContext   context   )  // overrides Delegate   // Protected Instance Methods  protected sealed override Delegate  CombineImpl  ( Delegate   follow   )  // overrides Delegate  protected sealed override object  DynamicInvokeImpl  (object[ ]   args   )  // overrides Delegate  protected sealed override Delegate  RemoveImpl  (Delegate   value   )  // overrides Delegate  } 

Hierarchy

Object Delegate(ICloneable , System.Runtime.Serialization.ISerializable) MulticastDelegate

Subclasses

Multiple types



C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net