X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem%2FRuntimeFieldHandle.cs;h=e18e60ead7ff9f119493006f86ced80cb4ff9066;hb=c39145af2464b19374fac41b252e07480ae1a197;hp=6adfedc948f4355ba3234ccf1d686f834476b6dc;hpb=bb05b19f7c93b758fbd22e600ea836c40e3c0b03;p=mono.git diff --git a/mcs/class/corlib/System/RuntimeFieldHandle.cs b/mcs/class/corlib/System/RuntimeFieldHandle.cs index 6adfedc948f..e18e60ead7f 100755 --- a/mcs/class/corlib/System/RuntimeFieldHandle.cs +++ b/mcs/class/corlib/System/RuntimeFieldHandle.cs @@ -8,6 +8,29 @@ // (C) Ximian, Inc. http://www.ximian.com // +// +// Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + using System.Reflection; using System.Runtime.Serialization; @@ -19,6 +42,11 @@ namespace System { IntPtr value; + internal RuntimeFieldHandle (IntPtr v) + { + value = v; + } + RuntimeFieldHandle (SerializationInfo info, StreamingContext context) { if (info == null) @@ -43,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 (); + } } }