// MethodToken.cs
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
namespace System.Reflection.Emit {
///
/// Represents the Token returned by the metadata to represent a Method.
///
[Serializable]
public struct MethodToken {
internal int tokValue;
public static readonly MethodToken Empty;
static MethodToken ()
{
Empty = new MethodToken ();
}
internal MethodToken (int val)
{
tokValue = val;
}
///
///
public override bool Equals (object obj)
{
bool res = obj is MethodToken;
if (res) {
MethodToken that = (MethodToken) obj;
res = (this.tokValue == that.tokValue);
}
return res;
}
///
/// Tests whether the given object is an instance of
/// MethodToken and has the same token value.
///
public override int GetHashCode ()
{
return tokValue;
}
///
/// Returns the metadata token for this Method.
///
public int Token {
get {
return tokValue;
}
}
}
}