Merge pull request #1898 from alexanderkyte/debugger_variable_reflection
[mono.git] / mcs / class / corlib / System.Reflection.Emit / TypeToken.cs
index 8fd6ae493b38cd98129c4f415794237735f8e1f8..9a8970e9cf1d7b60c9e46f8edaf02188d95fee25 100644 (file)
@@ -2,6 +2,31 @@
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if !FULL_AOT_RUNTIME
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
 
@@ -10,26 +35,18 @@ namespace System.Reflection.Emit {
        ///  Represents the Token returned by the metadata to represent a Type.
        /// </summary>
        [Serializable]
+       [ComVisible (true)]
        public struct TypeToken {
 
                internal int tokValue;
 
-               public static readonly TypeToken Empty;
-
-
-               static TypeToken ()
-               {
-                       Empty = new TypeToken ();
-               }
-
+               public static readonly TypeToken Empty = new TypeToken ();
 
                internal TypeToken (int val)
                {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -44,6 +61,20 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+               public bool Equals (TypeToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (TypeToken a, TypeToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (TypeToken a, TypeToken b)
+               {
+                       return !Equals (a, b);
+               }
 
                /// <summary>
                ///  Tests whether the given object is an instance of
@@ -68,3 +99,4 @@ namespace System.Reflection.Emit {
 
 }
 
+#endif