using System; using System.Collections; using System.Runtime.InteropServices; using System.Runtime.Serialization; namespace System { /// Represents a multicast delegate; that is, a delegate that can have more than one element in its invocation list. /// 2 // Token: 0x02000026 RID: 38 [ComVisible(true)] [Serializable] public abstract class MulticastDelegate : Delegate { /// Initializes a new instance of the class. /// The object on which is defined. /// The name of the method for which a delegate is created. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. // Token: 0x06000387 RID: 903 RVA: 0x0000DBC4 File Offset: 0x0000BDC4 protected MulticastDelegate(object target, string method) : base(target, method) { this.prev = null; } /// Initializes a new instance of the class. /// The type of object on which is defined. /// The name of the static method for which a delegate is created. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. // Token: 0x06000388 RID: 904 RVA: 0x0000DBD8 File Offset: 0x0000BDD8 protected MulticastDelegate(Type target, string method) : base(target, method) { this.prev = null; } /// Populates a object with all the data needed to serialize this instance. /// An object that holds all the data needed to serialize or deserialize this instance. /// (Reserved) The location where serialized data is stored and retrieved. /// /// is null. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// A serialization error occurred. /// 2 /// /// /// // Token: 0x06000389 RID: 905 RVA: 0x0000DBEC File Offset: 0x0000BDEC public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } /// Processes the full invocation list. /// An array of type that contains the return value of the encapsulated method. /// The arguments to pass to the encapsulated method. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism.-or- There is an attempt to invoke a method to which the caller does not have access (that is, a private method). /// The number, order, or type of parameters is invalid. /// An encapsulated method is not static, and the target object is null.-or- There is an attempt to invoke a method on an object or class that does not support the method. /// One of the encapsulated methods throws an exception. // Token: 0x0600038A RID: 906 RVA: 0x0000DBF8 File Offset: 0x0000BDF8 protected sealed override object DynamicInvokeImpl(object[] args) { if (this.prev != null) { this.prev.DynamicInvokeImpl(args); } return base.DynamicInvokeImpl(args); } /// Determines whether this multicast delegate and the specified object are equal. /// true if and this instance have the same invocation lists; otherwise, false. /// The object to compare with this instance. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// 2 // Token: 0x0600038B RID: 907 RVA: 0x0000DC1C File Offset: 0x0000BE1C public sealed override bool Equals(object obj) { if (!base.Equals(obj)) { return false; } MulticastDelegate multicastDelegate = obj as MulticastDelegate; if (multicastDelegate == null) { return false; } if (this.prev == null) { return multicastDelegate.prev == null; } return this.prev.Equals(multicastDelegate.prev); } /// Returns the hash code for this instance. /// A 32-bit signed integer hash code. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// 2 // Token: 0x0600038C RID: 908 RVA: 0x0000DC74 File Offset: 0x0000BE74 public sealed override int GetHashCode() { return base.GetHashCode(); } /// Returns the invocation list of this multicast delegate, in invocation order. /// An array of delegates whose invocation lists collectively match the invocation list of this instance. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// 2 // Token: 0x0600038D RID: 909 RVA: 0x0000DC7C File Offset: 0x0000BE7C public sealed override Delegate[] GetInvocationList() { MulticastDelegate multicastDelegate = (MulticastDelegate)this.Clone(); multicastDelegate.kpm_next = null; while (multicastDelegate.prev != null) { multicastDelegate.prev.kpm_next = multicastDelegate; multicastDelegate = multicastDelegate.prev; } if (multicastDelegate.kpm_next == null) { MulticastDelegate multicastDelegate2 = (MulticastDelegate)multicastDelegate.Clone(); multicastDelegate2.prev = null; multicastDelegate2.kpm_next = null; return new Delegate[] { multicastDelegate2 }; } ArrayList arrayList = new ArrayList(); while (multicastDelegate != null) { MulticastDelegate multicastDelegate3 = (MulticastDelegate)multicastDelegate.Clone(); multicastDelegate3.prev = null; multicastDelegate3.kpm_next = null; arrayList.Add(multicastDelegate3); multicastDelegate = multicastDelegate.kpm_next; } return (Delegate[])arrayList.ToArray(typeof(Delegate)); } /// Combines this with the specified to form a new delegate. /// A that is the new root of the invocation list. /// The delegate to combine with this delegate. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. // Token: 0x0600038E RID: 910 RVA: 0x0000DD40 File Offset: 0x0000BF40 protected sealed override Delegate CombineImpl(Delegate follow) { if (base.GetType() != follow.GetType()) { throw new ArgumentException(Locale.GetText("Incompatible Delegate Types.")); } MulticastDelegate multicastDelegate = (MulticastDelegate)follow.Clone(); multicastDelegate.SetMulticastInvoke(); MulticastDelegate multicastDelegate2 = multicastDelegate; for (MulticastDelegate multicastDelegate3 = ((MulticastDelegate)follow).prev; multicastDelegate3 != null; multicastDelegate3 = multicastDelegate3.prev) { multicastDelegate2.prev = (MulticastDelegate)multicastDelegate3.Clone(); multicastDelegate2 = multicastDelegate2.prev; } multicastDelegate2.prev = (MulticastDelegate)this.Clone(); multicastDelegate2 = multicastDelegate2.prev; for (MulticastDelegate multicastDelegate3 = this.prev; multicastDelegate3 != null; multicastDelegate3 = multicastDelegate3.prev) { multicastDelegate2.prev = (MulticastDelegate)multicastDelegate3.Clone(); multicastDelegate2 = multicastDelegate2.prev; } return multicastDelegate; } // Token: 0x0600038F RID: 911 RVA: 0x0000DE04 File Offset: 0x0000C004 private bool BaseEquals(MulticastDelegate value) { return base.Equals(value); } // Token: 0x06000390 RID: 912 RVA: 0x0000DE10 File Offset: 0x0000C010 private static MulticastDelegate KPM(MulticastDelegate needle, MulticastDelegate haystack, out MulticastDelegate tail) { MulticastDelegate multicastDelegate = needle; MulticastDelegate multicastDelegate2 = (needle.kpm_next = null); for (;;) { while (multicastDelegate2 != null && !multicastDelegate2.BaseEquals(multicastDelegate)) { multicastDelegate2 = multicastDelegate2.kpm_next; } multicastDelegate = multicastDelegate.prev; if (multicastDelegate == null) { break; } multicastDelegate2 = ((multicastDelegate2 != null) ? multicastDelegate2.prev : needle); if (multicastDelegate.BaseEquals(multicastDelegate2)) { multicastDelegate.kpm_next = multicastDelegate2.kpm_next; } else { multicastDelegate.kpm_next = multicastDelegate2; } } MulticastDelegate multicastDelegate3 = haystack; multicastDelegate2 = needle; multicastDelegate = haystack; for (;;) { while (multicastDelegate2 != null && !multicastDelegate2.BaseEquals(multicastDelegate)) { multicastDelegate2 = multicastDelegate2.kpm_next; multicastDelegate3 = multicastDelegate3.prev; } multicastDelegate2 = ((multicastDelegate2 != null) ? multicastDelegate2.prev : needle); if (multicastDelegate2 == null) { break; } multicastDelegate = multicastDelegate.prev; if (multicastDelegate == null) { goto Block_8; } } tail = multicastDelegate.prev; return multicastDelegate3; Block_8: tail = null; return null; } /// Removes an element from the invocation list of this that is equal to the specified delegate. /// If is found in the invocation list for this instance, then a new without in its invocation list; otherwise, this instance with its original invocation list. /// The delegate to search for in the invocation list. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. // Token: 0x06000391 RID: 913 RVA: 0x0000DEF8 File Offset: 0x0000C0F8 protected sealed override Delegate RemoveImpl(Delegate value) { if (value == null) { return this; } MulticastDelegate multicastDelegate2; MulticastDelegate multicastDelegate = MulticastDelegate.KPM((MulticastDelegate)value, this, out multicastDelegate2); if (multicastDelegate == null) { return this; } MulticastDelegate multicastDelegate3 = null; MulticastDelegate multicastDelegate4 = null; for (MulticastDelegate multicastDelegate5 = this; multicastDelegate5 != multicastDelegate; multicastDelegate5 = multicastDelegate5.prev) { MulticastDelegate multicastDelegate6 = (MulticastDelegate)multicastDelegate5.Clone(); if (multicastDelegate3 != null) { multicastDelegate3.prev = multicastDelegate6; } else { multicastDelegate4 = multicastDelegate6; } multicastDelegate3 = multicastDelegate6; } for (MulticastDelegate multicastDelegate5 = multicastDelegate2; multicastDelegate5 != null; multicastDelegate5 = multicastDelegate5.prev) { MulticastDelegate multicastDelegate7 = (MulticastDelegate)multicastDelegate5.Clone(); if (multicastDelegate3 != null) { multicastDelegate3.prev = multicastDelegate7; } else { multicastDelegate4 = multicastDelegate7; } multicastDelegate3 = multicastDelegate7; } if (multicastDelegate3 != null) { multicastDelegate3.prev = null; } return multicastDelegate4; } /// Determines whether two objects are equal. /// true if and have the same invocation lists; otherwise, false. /// The left operand. /// The right operand. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// 3 // Token: 0x06000392 RID: 914 RVA: 0x0000DFB8 File Offset: 0x0000C1B8 public static bool operator ==(MulticastDelegate d1, MulticastDelegate d2) { if (d1 == null) { return d2 == null; } return d1.Equals(d2); } /// Determines whether two objects are not equal. /// true if and do not have the same invocation lists; otherwise, false. /// The left operand. /// The right operand. /// Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. /// 3 // Token: 0x06000393 RID: 915 RVA: 0x0000DFCC File Offset: 0x0000C1CC public static bool operator !=(MulticastDelegate d1, MulticastDelegate d2) { if (d1 == null) { return d2 != null; } return !d1.Equals(d2); } // Token: 0x0400005A RID: 90 private MulticastDelegate prev; // Token: 0x0400005B RID: 91 private MulticastDelegate kpm_next; } }