summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
committerdotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
commitef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch)
treedee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
downloadcoreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'src/mscorlib/src/System/Reflection/Emit/MethodToken.cs')
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodToken.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
new file mode 100644
index 0000000000..eaf5a6d455
--- /dev/null
+++ b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
@@ -0,0 +1,64 @@
+// 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 Method to the ILGenerator class.
+**
+**
+===========================================================*/
+namespace System.Reflection.Emit {
+
+ using System;
+ using System.Reflection;
+ using System.Security.Permissions;
+
+ [Serializable]
+ [System.Runtime.InteropServices.ComVisible(true)]
+ public struct MethodToken
+ {
+ public static readonly MethodToken Empty = new MethodToken();
+ internal int m_method;
+
+ internal MethodToken(int str) {
+ m_method=str;
+ }
+
+ public int Token {
+ get { return m_method; }
+ }
+
+ public override int GetHashCode()
+ {
+ return m_method;
+ }
+
+ public override bool Equals(Object obj)
+ {
+ if (obj is MethodToken)
+ return Equals((MethodToken)obj);
+ else
+ return false;
+ }
+
+ public bool Equals(MethodToken obj)
+ {
+ return obj.m_method == m_method;
+ }
+
+ public static bool operator ==(MethodToken a, MethodToken b)
+ {
+ return a.Equals(b);
+ }
+
+ public static bool operator !=(MethodToken a, MethodToken b)
+ {
+ return !(a == b);
+ }
+
+ }
+}