using System; using System.Diagnostics; using System.Globalization; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Reflection { /// Discovers the attributes of a field and provides access to field metadata. // Token: 0x02000242 RID: 578 [ComDefaultInterface(typeof(_FieldInfo))] [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] [Serializable] public abstract class FieldInfo : MemberInfo, _FieldInfo { /// Maps a set of names to a corresponding set of dispatch identifiers. /// Reserved for future use. Must be IID_NULL. /// Passed-in array of names to be mapped. /// Count of the names to be mapped. /// The locale context in which to interpret the names. /// Caller-allocated array which receives the IDs corresponding to the names. /// Late-bound access using the COM IDispatch interface is not supported. // Token: 0x06001E17 RID: 7703 RVA: 0x0007072C File Offset: 0x0006E92C void _FieldInfo.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { throw new NotImplementedException(); } /// Retrieves the type information for an object, which can then be used to get the type information for an interface. /// The type information to return. /// The locale identifier for the type information. /// Receives a pointer to the requested type information object. /// Late-bound access using the COM IDispatch interface is not supported. // Token: 0x06001E18 RID: 7704 RVA: 0x00070734 File Offset: 0x0006E934 void _FieldInfo.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo) { throw new NotImplementedException(); } /// Retrieves the number of type information interfaces that an object provides (either 0 or 1). /// Points to a location that receives the number of type information interfaces provided by the object. /// Late-bound access using the COM IDispatch interface is not supported. // Token: 0x06001E19 RID: 7705 RVA: 0x0007073C File Offset: 0x0006E93C void _FieldInfo.GetTypeInfoCount(out uint pcTInfo) { throw new NotImplementedException(); } /// Provides access to properties and methods exposed by an object. /// Identifies the member. /// Reserved for future use. Must be IID_NULL. /// The locale context in which to interpret arguments. /// Flags describing the context of the call. /// Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays. /// Pointer to the location where the result is to be stored. /// Pointer to a structure that contains exception information. /// The index of the first argument that has an error. /// Late-bound access using the COM IDispatch interface is not supported. // Token: 0x06001E1A RID: 7706 RVA: 0x00070744 File Offset: 0x0006E944 void _FieldInfo.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) { throw new NotImplementedException(); } /// Gets the attributes associated with this field. /// The FieldAttributes for this field. // Token: 0x17000571 RID: 1393 // (get) Token: 0x06001E1B RID: 7707 public abstract FieldAttributes Attributes { get; } /// Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. /// A handle to the internal metadata representation of a field. // Token: 0x17000572 RID: 1394 // (get) Token: 0x06001E1C RID: 7708 public abstract RuntimeFieldHandle FieldHandle { get; } /// Gets the type of this field object. /// The type of this field object. // Token: 0x17000573 RID: 1395 // (get) Token: 0x06001E1D RID: 7709 public abstract Type FieldType { get; } /// When overridden in a derived class, returns the value of a field supported by a given object. /// An object containing the value of the field reflected by this instance. /// The object whose field value will be returned. /// The field is non-static and is null. /// A field is marked literal, but the field does not have one of the accepted literal types. /// The caller does not have permission to access this field. /// The method is neither declared nor inherited by the class of . // Token: 0x06001E1E RID: 7710 public abstract object GetValue(object obj); /// Gets a value indicating that this member is a field. /// A value indicating that this member is a field. // Token: 0x17000574 RID: 1396 // (get) Token: 0x06001E1F RID: 7711 RVA: 0x0007074C File Offset: 0x0006E94C public override MemberTypes MemberType { get { return MemberTypes.Field; } } /// Gets a value indicating whether the value is written at compile time and cannot be changed. /// true if the field has the Literal attribute set; otherwise, false. // Token: 0x17000575 RID: 1397 // (get) Token: 0x06001E20 RID: 7712 RVA: 0x00070750 File Offset: 0x0006E950 public bool IsLiteral { get { return (this.Attributes & FieldAttributes.Literal) != FieldAttributes.PrivateScope; } } /// Gets a value indicating whether the field is static. /// true if this field is static; otherwise, false. // Token: 0x17000576 RID: 1398 // (get) Token: 0x06001E21 RID: 7713 RVA: 0x00070764 File Offset: 0x0006E964 public bool IsStatic { get { return (this.Attributes & FieldAttributes.Static) != FieldAttributes.PrivateScope; } } /// Gets a value indicating whether the field can only be set in the body of the constructor. /// true if the field has the InitOnly attribute set; otherwise, false. // Token: 0x17000577 RID: 1399 // (get) Token: 0x06001E22 RID: 7714 RVA: 0x00070778 File Offset: 0x0006E978 public bool IsInitOnly { get { return (this.Attributes & FieldAttributes.InitOnly) != FieldAttributes.PrivateScope; } } /// Gets a value indicating whether the field is public. /// true if this field is public; otherwise, false. // Token: 0x17000578 RID: 1400 // (get) Token: 0x06001E23 RID: 7715 RVA: 0x0007078C File Offset: 0x0006E98C public bool IsPublic { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Public; } } /// Gets a value indicating whether the field is private. /// true if the field is private; otherwise; false. // Token: 0x17000579 RID: 1401 // (get) Token: 0x06001E24 RID: 7716 RVA: 0x0007079C File Offset: 0x0006E99C public bool IsPrivate { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Private; } } /// Gets a value indicating whether the visibility of this field is described by ; that is, the field is visible only within its class and derived classes. /// true if access to this field is exactly described by ; otherwise, false. // Token: 0x1700057A RID: 1402 // (get) Token: 0x06001E25 RID: 7717 RVA: 0x000707AC File Offset: 0x0006E9AC public bool IsFamily { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Family; } } /// Gets a value indicating whether the potential visibility of this field is described by ; that is, the field is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. /// true if the visibility of this field is exactly described by ; otherwise, false. // Token: 0x1700057B RID: 1403 // (get) Token: 0x06001E26 RID: 7718 RVA: 0x000707BC File Offset: 0x0006E9BC public bool IsAssembly { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Assembly; } } /// Gets a value indicating whether the visibility of this field is described by ; that is, the field can be accessed from derived classes, but only if they are in the same assembly. /// true if access to this field is exactly described by ; otherwise, false. // Token: 0x1700057C RID: 1404 // (get) Token: 0x06001E27 RID: 7719 RVA: 0x000707CC File Offset: 0x0006E9CC public bool IsFamilyAndAssembly { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.FamANDAssem; } } /// Gets a value indicating whether the potential visibility of this field is described by ; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly. /// true if access to this field is exactly described by ; otherwise, false. // Token: 0x1700057D RID: 1405 // (get) Token: 0x06001E28 RID: 7720 RVA: 0x000707DC File Offset: 0x0006E9DC public bool IsFamilyOrAssembly { get { return (this.Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.FamORAssem; } } /// Gets a value indicating whether the corresponding PinvokeImpl attribute is set in . /// true if the PinvokeImpl attribute is set in ; otherwise, false. // Token: 0x1700057E RID: 1406 // (get) Token: 0x06001E29 RID: 7721 RVA: 0x000707EC File Offset: 0x0006E9EC public bool IsPinvokeImpl { get { return (this.Attributes & FieldAttributes.PinvokeImpl) == FieldAttributes.PinvokeImpl; } } /// Gets a value indicating whether the corresponding SpecialName attribute is set in the enumerator. /// true if the SpecialName attribute is set in ; otherwise, false. // Token: 0x1700057F RID: 1407 // (get) Token: 0x06001E2A RID: 7722 RVA: 0x00070804 File Offset: 0x0006EA04 public bool IsSpecialName { get { return (this.Attributes & FieldAttributes.SpecialName) == FieldAttributes.SpecialName; } } /// Gets a value indicating whether this field has the NotSerialized attribute. /// true if the field has the NotSerialized attribute set; otherwise, false. // Token: 0x17000580 RID: 1408 // (get) Token: 0x06001E2B RID: 7723 RVA: 0x0007081C File Offset: 0x0006EA1C public bool IsNotSerialized { get { return (this.Attributes & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized; } } /// When overridden in a derived class, sets the value of the field supported by the given object. /// The object whose field value will be set. /// The value to assign to the field. /// A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding). /// A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If is null, then Binder.DefaultBinding is used. /// The software preferences of a particular culture. /// The caller does not have permission to access this field. /// The parameter is null and the field is an instance field. /// The field does not exist on the object.-or- The parameter cannot be converted and stored in the field. // Token: 0x06001E2C RID: 7724 public abstract void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture); /// Sets the value of the field supported by the given object. /// The object whose field value will be set. /// The value to assign to the field. /// The caller does not have permission to access this field. /// The parameter is null and the field is an instance field. /// The field does not exist on the object.-or- The parameter cannot be converted and stored in the field. // Token: 0x06001E2D RID: 7725 RVA: 0x00070834 File Offset: 0x0006EA34 [DebuggerStepThrough] [DebuggerHidden] public void SetValue(object obj, object value) { this.SetValue(obj, value, BindingFlags.Default, null, null); } // Token: 0x06001E2E RID: 7726 [MethodImpl(MethodImplOptions.InternalCall)] private static extern FieldInfo internal_from_handle_type(IntPtr field_handle, IntPtr type_handle); /// Gets a for the field represented by the specified handle. /// A object representing the field specified by . /// A structure that contains the handle to the internal metadata representation of a field. /// /// is invalid. // Token: 0x06001E2F RID: 7727 RVA: 0x00070844 File Offset: 0x0006EA44 public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle) { if (handle.Value == IntPtr.Zero) { throw new ArgumentException("The handle is invalid."); } return FieldInfo.internal_from_handle_type(handle.Value, IntPtr.Zero); } /// Gets a for the field represented by the specified handle, for the specified generic type. /// A object representing the field specified by , in the generic type specified by . /// A structure that contains the handle to the internal metadata representation of a field. /// A structure that contains the handle to the generic type that defines the field. /// /// is invalid.-or- is not compatible with . For example, is the runtime type handle of the generic type definition, and comes from a constructed type. See Remarks. // Token: 0x06001E30 RID: 7728 RVA: 0x00070884 File Offset: 0x0006EA84 [ComVisible(false)] public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle, RuntimeTypeHandle declaringType) { if (handle.Value == IntPtr.Zero) { throw new ArgumentException("The handle is invalid."); } FieldInfo fieldInfo = FieldInfo.internal_from_handle_type(handle.Value, declaringType.Value); if (fieldInfo == null) { throw new ArgumentException("The field handle and the type handle are incompatible."); } return fieldInfo; } // Token: 0x06001E31 RID: 7729 RVA: 0x000708D8 File Offset: 0x0006EAD8 internal virtual int GetFieldOffset() { throw new SystemException("This method should not be called"); } /// Returns the value of a field supported by a given object. /// An Object containing a field value. /// A structure that encapsulates a managed pointer to a location and a runtime representation of the type that might be stored at that location. /// The caller requires the Common Language Specification (CLS) alternative, but called this method instead. // Token: 0x06001E32 RID: 7730 RVA: 0x000708E4 File Offset: 0x0006EAE4 [CLSCompliant(false)] [MonoTODO("Not implemented")] public virtual object GetValueDirect(TypedReference obj) { throw new NotImplementedException(); } /// Sets the value of the field supported by the given object. /// A structure that encapsulates a managed pointer to a location and a runtime representation of the type that can be stored at that location. /// The value to assign to the field. /// The caller requires the Common Language Specification (CLS) alternative, but called this method instead. // Token: 0x06001E33 RID: 7731 RVA: 0x000708EC File Offset: 0x0006EAEC [MonoTODO("Not implemented")] [CLSCompliant(false)] public virtual void SetValueDirect(TypedReference obj, object value) { throw new NotImplementedException(); } // Token: 0x06001E34 RID: 7732 [MethodImpl(MethodImplOptions.InternalCall)] private extern UnmanagedMarshal GetUnmanagedMarshal(); // Token: 0x17000581 RID: 1409 // (get) Token: 0x06001E35 RID: 7733 RVA: 0x000708F4 File Offset: 0x0006EAF4 internal virtual UnmanagedMarshal UMarshal { get { return this.GetUnmanagedMarshal(); } } // Token: 0x06001E36 RID: 7734 RVA: 0x000708FC File Offset: 0x0006EAFC internal object[] GetPseudoCustomAttributes() { int num = 0; if (this.IsNotSerialized) { num++; } if (this.DeclaringType.IsExplicitLayout) { num++; } UnmanagedMarshal umarshal = this.UMarshal; if (umarshal != null) { num++; } if (num == 0) { return null; } object[] array = new object[num]; num = 0; if (this.IsNotSerialized) { array[num++] = new NonSerializedAttribute(); } if (this.DeclaringType.IsExplicitLayout) { array[num++] = new FieldOffsetAttribute(this.GetFieldOffset()); } if (umarshal != null) { array[num++] = umarshal.ToMarshalAsAttribute(); } return array; } // Token: 0x06001E37 RID: 7735 [MethodImpl(MethodImplOptions.InternalCall)] private extern Type[] GetTypeModifiers(bool optional); /// Gets an array of types that identify the optional custom modifiers of the field. /// An array of objects that identify the optional custom modifiers of the current field, such as . // Token: 0x06001E38 RID: 7736 RVA: 0x000709A0 File Offset: 0x0006EBA0 public virtual Type[] GetOptionalCustomModifiers() { Type[] typeModifiers = this.GetTypeModifiers(true); if (typeModifiers == null) { return Type.EmptyTypes; } return typeModifiers; } /// Gets an array of types that identify the required custom modifiers of the property. /// An array of objects that identify the required custom modifiers of the current property, such as or . // Token: 0x06001E39 RID: 7737 RVA: 0x000709C4 File Offset: 0x0006EBC4 public virtual Type[] GetRequiredCustomModifiers() { Type[] typeModifiers = this.GetTypeModifiers(false); if (typeModifiers == null) { return Type.EmptyTypes; } return typeModifiers; } /// Returns a literal value associated with the field by a compiler. /// An that contains the literal value associated with the field. If the literal value is a class type with an element value of zero, the return value is null. /// The Constant table in unmanaged metadata does not contain a constant value for the current property. /// The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the ECMA Partition II specification Metadata Logical Format: Other Structures, Element Types used in Signatures. // Token: 0x06001E3A RID: 7738 RVA: 0x000709E8 File Offset: 0x0006EBE8 public virtual object GetRawConstantValue() { throw new NotSupportedException("This non-CLS method is not implemented."); } /// Gets a object representing the type. /// A object representing the type. // Token: 0x06001E3B RID: 7739 RVA: 0x000709F4 File Offset: 0x0006EBF4 virtual Type System.Runtime.InteropServices._FieldInfo.GetType() { return base.GetType(); } } }