2010-06-22 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / FieldToken.cs
index 71384e02492d3c4a182b13410d6c9ba0c7dd7a21..13295696f839d09bf48b1eefbc2f0a9149cd642b 100644 (file)
@@ -25,6 +25,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
 
@@ -32,6 +33,7 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a Field.
        /// </summary>
+       [ComVisible (true)]
        [Serializable]
        public struct FieldToken {
 
@@ -51,8 +53,6 @@ namespace System.Reflection.Emit {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -68,6 +68,21 @@ namespace System.Reflection.Emit {
                }
 
 
+               public bool Equals (FieldToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (FieldToken a, FieldToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (FieldToken a, FieldToken b)
+               {
+                       return !Equals (a, b);
+               }
+
                /// <summary>
                ///  Tests whether the given object is an instance of
                ///  FieldToken and has the same token value.