2008-12-08 Ivan N. Zlatev <contact@i-nz.net>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / SignatureToken.cs
index 4d734d3754cfd262954bdccd1ed3e7f2f1a70e65..59592c27ff7bfe86894a83a9c2fe323c95a5cb0d 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,11 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a Signature.
        /// </summary>
+#if NET_2_0
+       [ComVisible (true)]
+#else
        [Serializable]
+#endif
        public struct SignatureToken {
 
                internal int tokValue;
@@ -51,8 +56,6 @@ namespace System.Reflection.Emit {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -67,6 +70,22 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+#if NET_2_0
+               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);
+               }
+#endif
 
                /// <summary>
                ///  Tests whether the given object is an instance of