Class FieldBase<V>
Represents reflected field.
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public abstract class FieldBase<V> : FieldInfo, IField, IMember<FieldInfo>, ICustomAttributeProvider, IEquatable<FieldInfo>
  Type Parameters
| Name | Description | 
|---|---|
| V | Type of field value.  | 
      
Properties
| Improve this Doc View SourceAttributes
Gets the attributes associated with this field.
Declaration
public override sealed FieldAttributes Attributes { get; }
  Property Value
| Type | Description | 
|---|---|
| FieldAttributes | 
CustomAttributes
Gets a collection that contains this member's custom attributes.
Declaration
public override sealed IEnumerable<CustomAttributeData> CustomAttributes { get; }
  Property Value
| Type | Description | 
|---|---|
| IEnumerable<CustomAttributeData> | 
DeclaringType
Gets the class that declares this field.
Declaration
public override sealed Type DeclaringType { get; }
  Property Value
| Type | Description | 
|---|---|
| DotNext.Reflection.Type | 
FieldHandle
Gets a handle to the internal metadata representation of this field.
Declaration
public override sealed RuntimeFieldHandle FieldHandle { get; }
  Property Value
| Type | Description | 
|---|---|
| RuntimeFieldHandle | 
FieldType
Gets type of this field.
Declaration
public override sealed Type FieldType { get; }
  Property Value
| Type | Description | 
|---|---|
| DotNext.Reflection.Type | 
IsReadOnly
Determines whether this field is read-only and cannot be modified.
Declaration
public bool IsReadOnly { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
IsSecurityCritical
Gets a value that indicates whether the field is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.
Declaration
public override sealed bool IsSecurityCritical { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
IsSecuritySafeCritical
Gets a value that indicates whether the field is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.
Declaration
public override sealed bool IsSecuritySafeCritical { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
IsSecurityTransparent
Gets a value that indicates whether the current field is transparent at the current trust level, and therefore cannot perform critical operations.
Declaration
public override sealed bool IsSecurityTransparent { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
MemberType
Always returns 
Declaration
public override sealed MemberTypes MemberType { get; }
  Property Value
| Type | Description | 
|---|---|
| MemberTypes | 
MetadataToken
Gets a value that identifies a metadata element.
Declaration
public override sealed int MetadataToken { get; }
  Property Value
| Type | Description | 
|---|---|
| Int32 | 
Module
Gets the module in which the type that declares the field represented by the current instance is defined.
Declaration
public override sealed Module Module { get; }
  Property Value
| Type | Description | 
|---|---|
| Module | 
Name
Gets name of the field.
Declaration
public override sealed string Name { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
ReflectedType
Gets the class object that was used to obtain this instance.
Declaration
public override sealed Type ReflectedType { get; }
  Property Value
| Type | Description | 
|---|---|
| DotNext.Reflection.Type | 
Methods
| Improve this Doc View SourceEquals(FieldInfo)
Determines whether this field is equal to the given field.
Declaration
public bool Equals(FieldInfo other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FieldInfo | other | Other field to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true if this object reflects the same field as the specified object; otherwise, false.  | 
      
Equals(Object)
Determines whether this field is equal to the given field.
Declaration
public override sealed bool Equals(object other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | other | Other field to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true if this object reflects the same field as the specified object; otherwise, false.  | 
      
GetCustomAttributes(Type, Boolean)
Returns an array of all custom attributes applied to this field.
Declaration
public override sealed object[] GetCustomAttributes(Type attributeType, bool inherit)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DotNext.Reflection.Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned.  | 
      
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false.  | 
      
Returns
| Type | Description | 
|---|---|
| Object[] | An array that contains all the custom attributes applied to this field.  | 
      
GetCustomAttributes(Boolean)
Returns an array of all custom attributes applied to this field.
Declaration
public override sealed object[] GetCustomAttributes(bool inherit)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false.  | 
      
Returns
| Type | Description | 
|---|---|
| Object[] | An array that contains all the custom attributes applied to this field.  | 
      
GetCustomAttributesData()
Gets a collection that contains this member's custom attributes.
Declaration
public override sealed IList<CustomAttributeData> GetCustomAttributesData()
  Returns
| Type | Description | 
|---|---|
| IList<CustomAttributeData> | 
GetHashCode()
Computes hash code uniquely identifies the reflected field.
Declaration
public override sealed int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| Int32 | The hash code of the field.  | 
      
GetOptionalCustomModifiers()
Gets an array of types that identify the optional custom modifiers of the field.
Declaration
public override sealed Type[] GetOptionalCustomModifiers()
  Returns
| Type | Description | 
|---|---|
| DotNext.Reflection.Type[] | An array of objects that identify the optional custom modifiers of the current field.  | 
      
GetRawConstantValue()
Returns a literal value associated with the field by a compiler.
Declaration
public override sealed object GetRawConstantValue()
  Returns
| Type | Description | 
|---|---|
| Object | 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.  | 
      
GetRequiredCustomModifiers()
Gets an array of types that identify the required custom modifiers of the field.
Declaration
public override sealed Type[] GetRequiredCustomModifiers()
  Returns
| Type | Description | 
|---|---|
| DotNext.Reflection.Type[] | An array of objects that identify the required custom modifiers of the current field.  | 
      
GetValue(Object)
Returns the value of a field supported by a given object.
Declaration
public override object GetValue(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | The object whose field value will be returned.  | 
      
Returns
| Type | Description | 
|---|---|
| Object | An object containing the value of the field reflected by this instance.  | 
      
GetValue(Object, out V)
Returns the value of a field supported by a given object.
Declaration
public abstract bool GetValue(object obj, out V value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | The object whose field value will be returned.  | 
      
| V | value | An object containing the value of the field reflected by this instance.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true, if field value is obtained successfully; otherwise, false.  | 
      
GetValueDirect(TypedReference)
Returns the value of a field supported by a given object.
Declaration
public override sealed object GetValueDirect(TypedReference obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TypedReference | obj | A managed pointer to a location and a runtime representation of the type that might be stored at that location.  | 
      
Returns
| Type | Description | 
|---|---|
| Object | An object containing the value of the field reflected by this instance.  | 
      
IsDefined(Type, Boolean)
Determines whether one or more attributes of the specified type or of its derived types is applied to this field.
Declaration
public override sealed bool IsDefined(Type attributeType, bool inherit)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DotNext.Reflection.Type | attributeType | The type of custom attribute to search for. The search includes derived types.  | 
      
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true if one or more instances of   | 
      
SetValue(Object, V)
Sets the value of the field supported by the given object.
Declaration
public abstract bool SetValue(object obj, V value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | The object whose field value will be set.  | 
      
| V | value | The value to assign to the field.  | 
      
Returns
| Type | Description | 
|---|---|
| Boolean | true, if field value is modified successfully; otherwise, false.  | 
      
SetValue(Object, Object, BindingFlags, Binder, CultureInfo)
Sets the value of the field supported by the given object.
Declaration
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | The object whose field value will be returned.  | 
      
| Object | value | The value to assign to the field.  | 
      
| BindingFlags | invokeAttr | The type of binding that is desired.  | 
      
| Binder | binder | A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection.  | 
      
| CultureInfo | culture | The software preferences of a particular culture.  | 
      
SetValueDirect(TypedReference, Object)
Sets the value of the field supported by the given object.
Declaration
public override sealed void SetValueDirect(TypedReference obj, object value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TypedReference | obj | A managed pointer to a location and a runtime representation of the type that might be stored at that location.  | 
      
| Object | value | The value to assign to the field.  | 
      
ToString()
Returns textual representation of this field.
Declaration
public override sealed string ToString()
  Returns
| Type | Description | 
|---|---|
| String | The textual representation of this field.  | 
      
Explicit Interface Implementations
| Improve this Doc View SourceIMember<FieldInfo>.RuntimeMember
Declaration
FieldInfo IMember<FieldInfo>.RuntimeMember { get; }
  Returns
| Type | Description | 
|---|---|
| FieldInfo |