5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
9 // TODO: Mucho left to implement
13 using System.Runtime.Serialization;
17 public abstract class Delegate : ICloneable, ISerializable {
18 protected Type target_type;
19 protected object target;
20 protected string method;
22 protected Delegate (object target, string method)
25 throw new ArgumentNullException ("Target object is null");
28 throw new ArgumentNullException ("method name is null");
30 this.target_type = null;
35 protected Delegate (Type target_type, string method)
38 throw new ArgumentNullException ("Target type is null");
41 throw new ArgumentNullException ("method string is null");
43 this.target_type = target_type;
49 public MethodInfo Method {
56 public object Target {
67 public abstract object Clone ();
69 public override bool Equals (object o)
71 if (!(o is System.Delegate))
74 Delegate d = (Delegate) o;
76 if ((d.target_type == target_type) &&
77 (d.target == target) &&
84 public override int GetHashCode ()
86 return method.GetHashCode ();
89 // This is from ISerializable
90 public void GetObjectData (SerializationInfo info, StreamingContext context)