mscorlib(4.0.0.0) API with additions
FieldToken.cs
2 
4 {
7  [ComVisible(true)]
8  public struct FieldToken
9  {
11  public static readonly FieldToken Empty;
12 
13  internal int m_fieldTok;
14 
15  internal object m_class;
16 
19  public int Token => m_fieldTok;
20 
21  internal FieldToken(int field, Type fieldClass)
22  {
23  m_fieldTok = field;
24  m_class = fieldClass;
25  }
26 
29  public override int GetHashCode()
30  {
31  return m_fieldTok;
32  }
33 
37  public override bool Equals(object obj)
38  {
39  if (obj is FieldToken)
40  {
41  return Equals((FieldToken)obj);
42  }
43  return false;
44  }
45 
50  public bool Equals(FieldToken obj)
51  {
52  if (obj.m_fieldTok == m_fieldTok)
53  {
54  return obj.m_class == m_class;
55  }
56  return false;
57  }
58 
64  public static bool operator ==(FieldToken a, FieldToken b)
65  {
66  return a.Equals(b);
67  }
68 
74  public static bool operator !=(FieldToken a, FieldToken b)
75  {
76  return !(a == b);
77  }
78  }
79 }
Definition: __Canon.cs:3
override int GetHashCode()
Generates the hash code for this field.
Definition: FieldToken.cs:29
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
static bool operator==(FieldToken a, FieldToken b)
Indicates whether two T:System.Reflection.Emit.FieldToken structures are equal.
Definition: FieldToken.cs:64
Specifies that the class can be serialized.
override bool Equals(object obj)
Determines if an object is an instance of FieldToken and is equal to this instance.
Definition: FieldToken.cs:37
static readonly FieldToken Empty
The default FieldToken with P:System.Reflection.Emit.FieldToken.Token value 0.
Definition: FieldToken.cs:11
static bool operator !=(FieldToken a, FieldToken b)
Indicates whether two T:System.Reflection.Emit.FieldToken structures are not equal.
Definition: FieldToken.cs:74
int Token
Retrieves the metadata token for this field.
Definition: FieldToken.cs:19
The FieldToken struct is an object representation of a token that represents a field.
Definition: FieldToken.cs:8
bool Equals(FieldToken obj)
Indicates whether the current instance is equal to the specified T:System.Reflection....
Definition: FieldToken.cs:50