2007-11-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / EventToken.cs
index b8406c21374ecf97cc4c46927570dd1effcc089e..d57a0033ceaa969086524b096be14cb3b859896f 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 Event.
        /// </summary>
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        [Serializable]
        public struct EventToken {
 
@@ -67,6 +71,22 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+#if NET_2_0
+               public bool Equals (EventToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (EventToken a, EventToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (EventToken a, EventToken b)
+               {
+                       return !Equals (a, b);
+               }
+#endif
 
                /// <summary>
                ///  Tests whether the given object is an instance of