2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / SignatureToken.cs
index 4d734d3754cfd262954bdccd1ed3e7f2f1a70e65..1dde91245f6fda1843364a57e1c63ba4159e446a 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,7 +33,7 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a Signature.
        /// </summary>
-       [Serializable]
+       [ComVisible (true)]
        public struct SignatureToken {
 
                internal int tokValue;
@@ -51,8 +52,6 @@ namespace System.Reflection.Emit {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -67,6 +66,20 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+               public bool Equals (SignatureToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (SignatureToken a, SignatureToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (SignatureToken a, SignatureToken b)
+               {
+                       return !Equals (a, b);
+               }
 
                /// <summary>
                ///  Tests whether the given object is an instance of