diff options
Diffstat (limited to 'src/mscorlib/src/System/Reflection/Emit/TypeToken.cs')
-rw-r--r-- | src/mscorlib/src/System/Reflection/Emit/TypeToken.cs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs new file mode 100644 index 0000000000..8c5c6b6e5d --- /dev/null +++ b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +/*============================================================ +** +** +** +** +** +** Purpose: Represents a Class to the ILGenerator class. +** +** +===========================================================*/ +namespace System.Reflection.Emit { + + using System; + using System.Reflection; + using System.Threading; + using System.Security.Permissions; + + [Serializable] + [System.Runtime.InteropServices.ComVisible(true)] + public struct TypeToken { + + public static readonly TypeToken Empty = new TypeToken(); + + internal int m_class; + +#if false + public TypeToken() { + m_class=0; + } +#endif + + internal TypeToken(int str) { + m_class=str; + } + + public int Token { + get { return m_class; } + } + + public override int GetHashCode() + { + return m_class; + } + + public override bool Equals(Object obj) + { + if (obj is TypeToken) + return Equals((TypeToken)obj); + else + return false; + } + + public bool Equals(TypeToken obj) + { + return obj.m_class == m_class; + } + + public static bool operator ==(TypeToken a, TypeToken b) + { + return a.Equals(b); + } + + public static bool operator !=(TypeToken a, TypeToken b) + { + return !(a == b); + } + + } +} + |