2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / corlib / System / RuntimeFieldHandle.cs
index d5bbdf152926c5d33280bfb5877de57be9af2ddf..e18e60ead7ff9f119493006f86ced80cb4ff9066 100755 (executable)
@@ -42,6 +42,11 @@ namespace System
        {
                IntPtr value;
 
+               internal RuntimeFieldHandle (IntPtr v)
+               {
+                       value = v;
+               }
+
                RuntimeFieldHandle (SerializationInfo info, StreamingContext context)
                {
                        if (info == null)
@@ -66,5 +71,24 @@ namespace System
 
                        info.AddValue ("FieldObj", (MonoField) FieldInfo.GetFieldFromHandle (this), typeof (MonoField));
                }
+
+
+               public override bool Equals (object obj)
+               {
+                       if (obj == null || GetType () != obj.GetType ())
+                               return false;
+
+                       return value == ((RuntimeFieldHandle)obj).Value;
+               }
+
+               public bool Equals (RuntimeFieldHandle handle)
+               {
+                       return value == handle.Value;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return value.GetHashCode ();
+               }
        }
 }