2 // System.MultiCastDelegate.cs
5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
9 // TODO: Mucho left to implement.
12 using System.Globalization;
15 public abstract class MulticastDelegate : Delegate {
17 Delegate [] invocation_list;
19 protected MulticastDelegate (object target, string method)
20 : base (target, method)
22 invocation_list = null;
25 protected MulticastDelegate (Type target_type, string method)
26 : base (target_type, method)
28 invocation_list = null;
31 private MulticastDelegate (Type target_type, string method, Delegate [] list)
32 : base (target_type, method)
34 invocation_list = list;
38 public MethodInfo Method {
46 // Equals: two multicast delegates are equal if their base is equal
47 // and their invocations list is equal.
49 public override bool Equals (object o)
51 if (!(o is System.MulticastDelegate))
57 MulticastDelegate d = (MulticastDelegate) o;
59 if (d.invocation_list == null){
60 if (invocation_list == null)
63 } else if (invocation_list == null)
67 foreach (Delegate del in invocation_list){
68 if (del != d.invocation_list [i++])
76 // FIXME: This could use some improvements.
78 public override int GetHashCode ()
80 return base.GetHashCode ();
84 // Combines this MulticastDelegate with the Delegate `follow'.
85 // This can combine MulticastDelegates and Delegates
88 protected override Delegate CombineImpl (Delegate follow)
91 throw new NotImplementedException ();
93 // FIXME: Implement me.
94 // This is not as simple to implement, as we can
95 // not create an instance of MulticastDelegate.
97 // Got to think more about this.
101 public static bool operator == (MulticastDelegate a, MulticastDelegate b) {
102 throw new NotImplementedException ();
105 public static bool operator != (MulticastDelegate a, MulticastDelegate b) {
106 throw new NotImplementedException ();