using System; using System.Reflection; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Serialization; namespace System { /// Represents a field using an internal metadata token. /// 2 // Token: 0x0200003B RID: 59 [ComVisible(true)] [MonoTODO("Serialization needs tests")] [Serializable] public struct RuntimeFieldHandle : ISerializable { // Token: 0x06000639 RID: 1593 RVA: 0x0001465C File Offset: 0x0001285C internal RuntimeFieldHandle(IntPtr v) { this.value = v; } // Token: 0x0600063A RID: 1594 RVA: 0x00014668 File Offset: 0x00012868 private RuntimeFieldHandle(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException("info"); } MonoField monoField = (MonoField)info.GetValue("FieldObj", typeof(MonoField)); this.value = monoField.FieldHandle.Value; if (this.value == IntPtr.Zero) { throw new SerializationException(Locale.GetText("Insufficient state.")); } } /// Gets a handle to the field represented by the current instance. /// An that contains the handle to the field represented by the current instance. /// 2 // Token: 0x170000AA RID: 170 // (get) Token: 0x0600063B RID: 1595 RVA: 0x000146DC File Offset: 0x000128DC public IntPtr Value { get { return this.value; } } /// Populates a with the data necessary to deserialize the field represented by the current instance. /// The object to populate with serialization information. /// (Reserved) The place to store and retrieve serialized data. /// /// is null. /// The property of the current instance is not a valid handle. /// 2 // Token: 0x0600063C RID: 1596 RVA: 0x000146E4 File Offset: 0x000128E4 public void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException("info"); } if (this.value == IntPtr.Zero) { throw new SerializationException("Object fields may not be properly initialized"); } info.AddValue("FieldObj", (MonoField)FieldInfo.GetFieldFromHandle(this), typeof(MonoField)); } /// Indicates whether the current instance is equal to the specified object. /// true if is a and equal to the value of the current instance; otherwise, false. /// The object to compare to the current instance. /// 2 // Token: 0x0600063D RID: 1597 RVA: 0x00014748 File Offset: 0x00012948 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public override bool Equals(object obj) { return obj != null && base.GetType() == obj.GetType() && this.value == ((RuntimeFieldHandle)obj).Value; } /// Indicates whether the current instance is equal to the specified . /// true if the value of is equal to the value of the current instance; otherwise, false. /// The to compare to the current instance. /// 2 // Token: 0x0600063E RID: 1598 RVA: 0x00014794 File Offset: 0x00012994 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public bool Equals(RuntimeFieldHandle handle) { return this.value == handle.Value; } /// 2 // Token: 0x0600063F RID: 1599 RVA: 0x000147A8 File Offset: 0x000129A8 public override int GetHashCode() { return this.value.GetHashCode(); } /// Indicates whether two structures are equal. /// true if is equal to ; otherwise, false. /// The to compare to . /// The to compare to . /// 3 // Token: 0x06000640 RID: 1600 RVA: 0x000147B8 File Offset: 0x000129B8 public static bool operator ==(RuntimeFieldHandle left, RuntimeFieldHandle right) { return left.Equals(right); } /// Indicates whether two structures are not equal. /// true if is not equal to ; otherwise, false. /// The to compare to . /// The to compare to . /// 3 // Token: 0x06000641 RID: 1601 RVA: 0x000147C4 File Offset: 0x000129C4 public static bool operator !=(RuntimeFieldHandle left, RuntimeFieldHandle right) { return !left.Equals(right); } // Token: 0x04000081 RID: 129 private IntPtr value; } }