mscorlib(4.0.0.0) API with additions
System.Reflection.FieldInfo Class Referenceabstract

Discovers the attributes of a field and provides access to field metadata. More...

Inheritance diagram for System.Reflection.FieldInfo:
[legend]
Collaboration diagram for System.Reflection.FieldInfo:
[legend]

Public Member Functions

override bool Equals (object obj)
 Returns a value that indicates whether this instance is equal to a specified object. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 
virtual Type [] GetRequiredCustomModifiers ()
 Gets an array of types that identify the required custom modifiers of the property. More...
 
virtual Type [] GetOptionalCustomModifiers ()
 Gets an array of types that identify the optional custom modifiers of the field. More...
 
virtual void SetValueDirect (TypedReference obj, object value)
 Sets the value of the field supported by the given object. More...
 
virtual object GetValueDirect (TypedReference obj)
 Returns the value of a field supported by a given object. More...
 
abstract object GetValue (object obj)
 When overridden in a derived class, returns the value of a field supported by a given object. More...
 
virtual object GetRawConstantValue ()
 Returns a literal value associated with the field by a compiler. More...
 
abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
 When overridden in a derived class, sets the value of the field supported by the given object. More...
 
void SetValue (object obj, object value)
 Sets the value of the field supported by the given object. More...
 
- Public Member Functions inherited from System.Reflection.MemberInfo
abstract object [] GetCustomAttributes (bool inherit)
 When overridden in a derived class, returns an array of all custom attributes applied to this member. More...
 
abstract object [] GetCustomAttributes (Type attributeType, bool inherit)
 When overridden in a derived class, returns an array of custom attributes applied to this member and identified by T:System.Type. More...
 
abstract bool IsDefined (Type attributeType, bool inherit)
 When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. More...
 
virtual IList< CustomAttributeDataGetCustomAttributesData ()
 Returns a list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the target member. More...
 
override bool Equals (object obj)
 Returns a value that indicates whether this instance is equal to a specified object. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 
- Public Member Functions inherited from System.Runtime.InteropServices._MemberInfo
new string ToString ()
 Provides COM objects with version-independent access to the M:System.Object.ToString method. More...
 
- Public Member Functions inherited from System.Runtime.InteropServices._FieldInfo
new string ToString ()
 Provides COM objects with version-independent access to the M:System.Object.ToString method. More...
 
object [] GetCustomAttributes (Type attributeType, bool inherit)
 Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Type,System.Boolean) method. More...
 
object [] GetCustomAttributes (bool inherit)
 Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean) method. More...
 
bool IsDefined (Type attributeType, bool inherit)
 Provides COM objects with version-independent access to the M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean) method. More...
 

Static Public Member Functions

static FieldInfo GetFieldFromHandle (RuntimeFieldHandle handle)
 Gets a T:System.Reflection.FieldInfo for the field represented by the specified handle. More...
 
static FieldInfo GetFieldFromHandle (RuntimeFieldHandle handle, RuntimeTypeHandle declaringType)
 Gets a T:System.Reflection.FieldInfo for the field represented by the specified handle, for the specified generic type. More...
 
static bool operator== (FieldInfo left, FieldInfo right)
 Indicates whether two T:System.Reflection.FieldInfo objects are equal. More...
 
static bool operator != (FieldInfo left, FieldInfo right)
 Indicates whether two T:System.Reflection.FieldInfo objects are not equal. More...
 
- Static Public Member Functions inherited from System.Reflection.MemberInfo
static bool operator== (MemberInfo left, MemberInfo right)
 Indicates whether two T:System.Reflection.MemberInfo objects are equal. More...
 
static bool operator != (MemberInfo left, MemberInfo right)
 Indicates whether two T:System.Reflection.MemberInfo objects are not equal. More...
 

Public Attributes

override MemberTypes MemberType => MemberTypes.Field
 Gets a T:System.Reflection.MemberTypes value indicating that this member is a field. More...
 
bool IsNotSerialized => (Attributes & FieldAttributes.NotSerialized) != FieldAttributes.PrivateScope
 Gets a value indicating whether this field has the NotSerialized attribute. More...
 
bool IsPinvokeImpl => (Attributes & FieldAttributes.PinvokeImpl) != FieldAttributes.PrivateScope
 Gets a value indicating whether the corresponding PinvokeImpl attribute is set in T:System.Reflection.FieldAttributes. More...
 
virtual bool IsSecurityCritical => FieldHandle.IsSecurityCritical()
 Gets a value that indicates whether the current field is security-critical or security-safe-critical at the current trust level. More...
 
virtual bool IsSecuritySafeCritical => FieldHandle.IsSecuritySafeCritical()
 Gets a value that indicates whether the current field is security-safe-critical at the current trust level. More...
 
virtual bool IsSecurityTransparent => FieldHandle.IsSecurityTransparent()
 Gets a value that indicates whether the current field is transparent at the current trust level. More...
 

Properties

abstract RuntimeFieldHandle FieldHandle [get]
 Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. More...
 
abstract Type FieldType [get]
 Gets the type of this field object. More...
 
abstract FieldAttributes Attributes [get]
 Gets the attributes associated with this field. More...
 
bool IsPublic [get]
 Gets a value indicating whether the field is public. More...
 
bool IsPrivate [get]
 Gets a value indicating whether the field is private. More...
 
bool IsFamily [get]
 Gets a value indicating whether the visibility of this field is described by F:System.Reflection.FieldAttributes.Family; that is, the field is visible only within its class and derived classes. More...
 
bool IsAssembly [get]
 Gets a value indicating whether the potential visibility of this field is described by F:System.Reflection.FieldAttributes.Assembly; 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. More...
 
bool IsFamilyAndAssembly [get]
 Gets a value indicating whether the visibility of this field is described by F:System.Reflection.FieldAttributes.FamANDAssem; that is, the field can be accessed from derived classes, but only if they are in the same assembly. More...
 
bool IsFamilyOrAssembly [get]
 Gets a value indicating whether the potential visibility of this field is described by F:System.Reflection.FieldAttributes.FamORAssem; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly. More...
 
bool IsStatic [get]
 Gets a value indicating whether the field is static. More...
 
bool IsInitOnly [get]
 Gets a value indicating whether the field can only be set in the body of the constructor. More...
 
bool IsLiteral [get]
 Gets a value indicating whether the value is written at compile time and cannot be changed. More...
 
bool IsSpecialName [get]
 Gets a value indicating whether the corresponding SpecialName attribute is set in the T:System.Reflection.FieldAttributes enumerator. More...
 
- Properties inherited from System.Reflection.MemberInfo
abstract MemberTypes MemberType [get]
 When overridden in a derived class, gets a T:System.Reflection.MemberTypes value indicating the type of the member — method, constructor, event, and so on. More...
 
abstract string Name [get]
 Gets the name of the current member. More...
 
abstract Type DeclaringType [get]
 Gets the class that declares this member. More...
 
abstract Type ReflectedType [get]
 Gets the class object that was used to obtain this instance of MemberInfo. More...
 
virtual IEnumerable< CustomAttributeDataCustomAttributes [get]
 Gets a collection that contains this member's custom attributes. More...
 
virtual int MetadataToken [get]
 Gets a value that identifies a metadata element. More...
 
virtual Module Module [get]
 Gets the module in which the type that declares the member represented by the current T:System.Reflection.MemberInfo is defined. More...
 
- Properties inherited from System.Runtime.InteropServices._MemberInfo
MemberTypes MemberType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.MemberType property. More...
 
string Name [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More...
 
Type DeclaringType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More...
 
Type ReflectedType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More...
 
- Properties inherited from System.Runtime.InteropServices._FieldInfo
MemberTypes MemberType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.MemberType property. More...
 
string Name [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.Name property. More...
 
Type DeclaringType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.DeclaringType property. More...
 
Type ReflectedType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.MemberInfo.ReflectedType property. More...
 
Type FieldType [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.FieldType property. More...
 
RuntimeFieldHandle FieldHandle [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.FieldHandle property. More...
 
FieldAttributes Attributes [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.Attributes property. More...
 
bool IsPublic [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsPublic property. More...
 
bool IsPrivate [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsPrivate property. More...
 
bool IsFamily [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsFamily property. More...
 
bool IsAssembly [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsAssembly property. More...
 
bool IsFamilyAndAssembly [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsFamilyAndAssembly property. More...
 
bool IsFamilyOrAssembly [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsFamilyOrAssembly property. More...
 
bool IsStatic [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsStatic property. More...
 
bool IsInitOnly [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsInitOnly property. More...
 
bool IsLiteral [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsLiteral property. More...
 
bool IsNotSerialized [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsNotSerialized property. More...
 
bool IsSpecialName [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsSpecialName property. More...
 
bool IsPinvokeImpl [get]
 Provides COM objects with version-independent access to the P:System.Reflection.FieldInfo.IsPinvokeImpl property. More...
 

Detailed Description

Discovers the attributes of a field and provides access to field metadata.

Definition at line 15 of file FieldInfo.cs.

Member Function Documentation

◆ Equals()

override bool System.Reflection.FieldInfo.Equals ( object  obj)

Returns a value that indicates whether this instance is equal to a specified object.

Parameters
objAn object to compare with this instance, or null.
Returns
true if obj equals the type and value of this instance; otherwise, false.

Implements System.Runtime.InteropServices._FieldInfo.

Definition at line 277 of file FieldInfo.cs.

◆ GetFieldFromHandle() [1/2]

static FieldInfo System.Reflection.FieldInfo.GetFieldFromHandle ( RuntimeFieldHandle  handle)
static

Gets a T:System.Reflection.FieldInfo for the field represented by the specified handle.

Parameters
handleA T:System.RuntimeFieldHandle structure that contains the handle to the internal metadata representation of a field.
Returns
A T:System.Reflection.FieldInfo object representing the field specified by handle .
Exceptions
T:System.ArgumentExceptionhandle is invalid.

Definition at line 209 of file FieldInfo.cs.

◆ GetFieldFromHandle() [2/2]

static FieldInfo System.Reflection.FieldInfo.GetFieldFromHandle ( RuntimeFieldHandle  handle,
RuntimeTypeHandle  declaringType 
)
static

Gets a T:System.Reflection.FieldInfo for the field represented by the specified handle, for the specified generic type.

Parameters
handleA T:System.RuntimeFieldHandle structure that contains the handle to the internal metadata representation of a field.
declaringTypeA T:System.RuntimeTypeHandle structure that contains the handle to the generic type that defines the field.
Returns
A T:System.Reflection.FieldInfo object representing the field specified by handle , in the generic type specified by declaringType .
Exceptions
T:System.ArgumentExceptionhandle is invalid.-or- declaringType is not compatible with handle . For example, declaringType is the runtime type handle of the generic type definition, and handle comes from a constructed type. See Remarks.

Definition at line 233 of file FieldInfo.cs.

◆ GetHashCode()

override int System.Reflection.FieldInfo.GetHashCode ( )

Returns the hash code for this instance.

Returns
A 32-bit signed integer hash code.

Implements System.Runtime.InteropServices._FieldInfo.

Definition at line 285 of file FieldInfo.cs.

◆ GetOptionalCustomModifiers()

virtual Type [] System.Reflection.FieldInfo.GetOptionalCustomModifiers ( )
virtual

Gets an array of types that identify the optional custom modifiers of the field.

Returns
An array of T:System.Type objects that identify the optional custom modifiers of the current field, such as T:System.Runtime.CompilerServices.IsConst.

Definition at line 299 of file FieldInfo.cs.

◆ GetRawConstantValue()

virtual object System.Reflection.FieldInfo.GetRawConstantValue ( )
virtual

Returns a literal value associated with the field by a compiler.

Returns
An T:System.Object 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.
Exceptions
T:System.InvalidOperationExceptionThe Constant table in unmanaged metadata does not contain a constant value for the current field.
T:System.FormatExceptionThe 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.
T:System.NotSupportedExceptionThe constant value for the field is not set.

Definition at line 341 of file FieldInfo.cs.

◆ GetRequiredCustomModifiers()

virtual Type [] System.Reflection.FieldInfo.GetRequiredCustomModifiers ( )
virtual

Gets an array of types that identify the required custom modifiers of the property.

Returns
An array of T:System.Type objects that identify the required custom modifiers of the current property, such as T:System.Runtime.CompilerServices.IsConst or T:System.Runtime.CompilerServices.IsImplicitlyDereferenced.

Definition at line 292 of file FieldInfo.cs.

◆ GetValue()

abstract object System.Reflection.FieldInfo.GetValue ( object  obj)
pure virtual

When overridden in a derived class, returns the value of a field supported by a given object.

Parameters
objThe object whose field value will be returned.
Returns
An object containing the value of the field reflected by this instance.
Exceptions
T:System.Reflection.TargetExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch T:System.Exception instead.The field is non-static and obj is null.
T:System.NotSupportedExceptionA field is marked literal, but the field does not have one of the accepted literal types.
T:System.FieldAccessExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.MemberAccessException, instead.The caller does not have permission to access this field.
T:System.ArgumentExceptionThe method is neither declared nor inherited by the class of obj .

Implements System.Runtime.InteropServices._FieldInfo.

Implemented in System.Reflection.Emit.FieldBuilder.

◆ GetValueDirect()

virtual object System.Reflection.FieldInfo.GetValueDirect ( TypedReference  obj)
virtual

Returns the value of a field supported by a given object.

Parameters
obj
  A <see cref="T:System.TypedReference" /> structure that encapsulates a managed pointer to a location and a runtime representation of the type that might be stored at that location. </param>
Returns
An Object containing a field value.
Exceptions
T:System.NotSupportedExceptionThe caller requires the Common Language Specification (CLS) alternative, but called this method instead.

Implements System.Runtime.InteropServices._FieldInfo.

Definition at line 321 of file FieldInfo.cs.

◆ operator !=()

static bool System.Reflection.FieldInfo.operator != ( FieldInfo  left,
FieldInfo  right 
)
static

Indicates whether two T:System.Reflection.FieldInfo objects are not equal.

Parameters
leftThe first object to compare.
rightThe second object to compare.
Returns
true if left is not equal to right ; otherwise, false.

Definition at line 267 of file FieldInfo.cs.

◆ operator==()

static bool System.Reflection.FieldInfo.operator== ( FieldInfo  left,
FieldInfo  right 
)
static

Indicates whether two T:System.Reflection.FieldInfo objects are equal.

Parameters
leftThe first object to compare.
rightThe second object to compare.
Returns
true if left is equal to right ; otherwise, false.

Definition at line 248 of file FieldInfo.cs.

◆ SetValue() [1/2]

abstract void System.Reflection.FieldInfo.SetValue ( object  obj,
object  value,
BindingFlags  invokeAttr,
Binder  binder,
CultureInfo  culture 
)
pure virtual

When overridden in a derived class, sets the value of the field supported by the given object.

Parameters
objThe object whose field value will be set.
valueThe value to assign to the field.
invokeAttrA field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding).
binderA set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If binder is null, then Binder.DefaultBinding is used.
cultureThe software preferences of a particular culture.
Exceptions
T:System.FieldAccessExceptionThe caller does not have permission to access this field.
T:System.Reflection.TargetExceptionThe obj parameter is null and the field is an instance field.
T:System.ArgumentExceptionThe field does not exist on the object.-or- The value parameter cannot be converted and stored in the field.

Implements System.Runtime.InteropServices._FieldInfo.

Implemented in System.Reflection.Emit.FieldBuilder.

◆ SetValue() [2/2]

void System.Reflection.FieldInfo.SetValue ( object  obj,
object  value 
)

Sets the value of the field supported by the given object.

Parameters
objThe object whose field value will be set.
valueThe value to assign to the field.
Exceptions
T:System.FieldAccessExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.MemberAccessException, instead.The caller does not have permission to access this field.
T:System.Reflection.TargetExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch T:System.Exception instead.The obj parameter is null and the field is an instance field.
T:System.ArgumentExceptionThe field does not exist on the object.-or- The value parameter cannot be converted and stored in the field.

Implements System.Runtime.InteropServices._FieldInfo.

Definition at line 368 of file FieldInfo.cs.

◆ SetValueDirect()

virtual void System.Reflection.FieldInfo.SetValueDirect ( TypedReference  obj,
object  value 
)
virtual

Sets the value of the field supported by the given object.

Parameters
objA T:System.TypedReference structure that encapsulates a managed pointer to a location and a runtime representation of the type that can be stored at that location.
valueThe value to assign to the field.
Exceptions
T:System.NotSupportedExceptionThe caller requires the Common Language Specification (CLS) alternative, but called this method instead.

Implements System.Runtime.InteropServices._FieldInfo.

Definition at line 309 of file FieldInfo.cs.

Member Data Documentation

◆ IsNotSerialized

bool System.Reflection.FieldInfo.IsNotSerialized => (Attributes & FieldAttributes.NotSerialized) != FieldAttributes.PrivateScope

Gets a value indicating whether this field has the NotSerialized attribute.

Returns
true if the field has the NotSerialized attribute set; otherwise, false.

Definition at line 168 of file FieldInfo.cs.

◆ IsPinvokeImpl

bool System.Reflection.FieldInfo.IsPinvokeImpl => (Attributes & FieldAttributes.PinvokeImpl) != FieldAttributes.PrivateScope

Gets a value indicating whether the corresponding PinvokeImpl attribute is set in T:System.Reflection.FieldAttributes.

Returns
true if the PinvokeImpl attribute is set in T:System.Reflection.FieldAttributes; otherwise, false.

Definition at line 186 of file FieldInfo.cs.

◆ IsSecurityCritical

virtual bool System.Reflection.FieldInfo.IsSecurityCritical => FieldHandle.IsSecurityCritical()

Gets a value that indicates whether the current field is security-critical or security-safe-critical at the current trust level.

Returns
true if the current field is security-critical or security-safe-critical at the current trust level; false if it is transparent.

Definition at line 191 of file FieldInfo.cs.

◆ IsSecuritySafeCritical

virtual bool System.Reflection.FieldInfo.IsSecuritySafeCritical => FieldHandle.IsSecuritySafeCritical()

Gets a value that indicates whether the current field is security-safe-critical at the current trust level.

Returns
true if the current field is security-safe-critical at the current trust level; false if it is security-critical or transparent.

Definition at line 196 of file FieldInfo.cs.

◆ IsSecurityTransparent

virtual bool System.Reflection.FieldInfo.IsSecurityTransparent => FieldHandle.IsSecurityTransparent()

Gets a value that indicates whether the current field is transparent at the current trust level.

Returns
true if the field is security-transparent at the current trust level; otherwise, false.

Definition at line 201 of file FieldInfo.cs.

◆ MemberType

override MemberTypes System.Reflection.FieldInfo.MemberType => MemberTypes.Field

Gets a T:System.Reflection.MemberTypes value indicating that this member is a field.

Returns
A T:System.Reflection.MemberTypes value indicating that this member is a field.

Definition at line 19 of file FieldInfo.cs.

Property Documentation

◆ Attributes

abstract FieldAttributes System.Reflection.FieldInfo.Attributes
get

Gets the attributes associated with this field.

Returns
The FieldAttributes for this field.

Definition at line 43 of file FieldInfo.cs.

◆ FieldHandle

abstract RuntimeFieldHandle System.Reflection.FieldInfo.FieldHandle
get

Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field.

Returns
A handle to the internal metadata representation of a field.

Definition at line 25 of file FieldInfo.cs.

◆ FieldType

abstract Type System.Reflection.FieldInfo.FieldType
get

Gets the type of this field object.

Returns
The type of this field object.

Definition at line 34 of file FieldInfo.cs.

◆ IsAssembly

bool System.Reflection.FieldInfo.IsAssembly
get

Gets a value indicating whether the potential visibility of this field is described by F:System.Reflection.FieldAttributes.Assembly; 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.

Returns
true if the visibility of this field is exactly described by F:System.Reflection.FieldAttributes.Assembly; otherwise, false.

Definition at line 92 of file FieldInfo.cs.

◆ IsFamily

bool System.Reflection.FieldInfo.IsFamily
get

Gets a value indicating whether the visibility of this field is described by F:System.Reflection.FieldAttributes.Family; that is, the field is visible only within its class and derived classes.

Returns
true if access to this field is exactly described by F:System.Reflection.FieldAttributes.Family; otherwise, false.

Definition at line 79 of file FieldInfo.cs.

◆ IsFamilyAndAssembly

bool System.Reflection.FieldInfo.IsFamilyAndAssembly
get

Gets a value indicating whether the visibility of this field is described by F:System.Reflection.FieldAttributes.FamANDAssem; that is, the field can be accessed from derived classes, but only if they are in the same assembly.

Returns
true if access to this field is exactly described by F:System.Reflection.FieldAttributes.FamANDAssem; otherwise, false.

Definition at line 105 of file FieldInfo.cs.

◆ IsFamilyOrAssembly

bool System.Reflection.FieldInfo.IsFamilyOrAssembly
get

Gets a value indicating whether the potential visibility of this field is described by F:System.Reflection.FieldAttributes.FamORAssem; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly.

Returns
true if access to this field is exactly described by F:System.Reflection.FieldAttributes.FamORAssem; otherwise, false.

Definition at line 118 of file FieldInfo.cs.

◆ IsInitOnly

bool System.Reflection.FieldInfo.IsInitOnly
get

Gets a value indicating whether the field can only be set in the body of the constructor.

Returns
true if the field has the InitOnly attribute set; otherwise, false.

Definition at line 144 of file FieldInfo.cs.

◆ IsLiteral

bool System.Reflection.FieldInfo.IsLiteral
get

Gets a value indicating whether the value is written at compile time and cannot be changed.

Returns
true if the field has the Literal attribute set; otherwise, false.

Definition at line 157 of file FieldInfo.cs.

◆ IsPrivate

bool System.Reflection.FieldInfo.IsPrivate
get

Gets a value indicating whether the field is private.

Returns
true if the field is private; otherwise; false.

Definition at line 66 of file FieldInfo.cs.

◆ IsPublic

bool System.Reflection.FieldInfo.IsPublic
get

Gets a value indicating whether the field is public.

Returns
true if this field is public; otherwise, false.

Definition at line 53 of file FieldInfo.cs.

◆ IsSpecialName

bool System.Reflection.FieldInfo.IsSpecialName
get

Gets a value indicating whether the corresponding SpecialName attribute is set in the T:System.Reflection.FieldAttributes enumerator.

Returns
true if the SpecialName attribute is set in T:System.Reflection.FieldAttributes; otherwise, false.

Definition at line 175 of file FieldInfo.cs.

◆ IsStatic

bool System.Reflection.FieldInfo.IsStatic
get

Gets a value indicating whether the field is static.

Returns
true if this field is static; otherwise, false.

Definition at line 131 of file FieldInfo.cs.


The documentation for this class was generated from the following file: