2008-12-08 Ivan N. Zlatev <contact@i-nz.net>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / MethodToken.cs
index 8fc9455c082f450c82e7d3b1cf72d613aebe3fa6..f3351e8874f4d0e298ba50146bae2667eaf0f7e8 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,9 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a Method.
        /// </summary>
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        [Serializable]
        public struct MethodToken {
 
@@ -51,8 +55,6 @@ namespace System.Reflection.Emit {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -67,6 +69,22 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+#if NET_2_0
+               public bool Equals (MethodToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (MethodToken a, MethodToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (MethodToken a, MethodToken b)
+               {
+                       return !Equals (a, b);
+               }
+#endif
 
                /// <summary>
                ///  Tests whether the given object is an instance of