Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Discovers the attributes of a field and provides access to field metadata.
Inheritance Hierarchy
System. . :: . .Object
System.Reflection. . :: . .MemberInfo
System.Reflection..::..FieldInfo
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
<SerializableAttribute> _
Public MustInherit Class FieldInfo _
Inherits MemberInfo
[SerializableAttribute]
public abstract class FieldInfo : MemberInfo
[SerializableAttribute]
public ref class FieldInfo abstract : public MemberInfo
[<AbstractClass>]
[<SerializableAttribute>]
type FieldInfo =
class
inherit MemberInfo
end
public abstract class FieldInfo extends MemberInfo
The FieldInfo type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
FieldInfo | Initializes a new instance of the FieldInfo class. |
Top
Properties
Name | Description | |
---|---|---|
![]() |
DeclaringType | Gets the class that declares this member. (Inherited from MemberInfo.) |
![]() |
FieldType | Gets the type of this field object. |
![]() |
MemberType | Gets a MemberTypes value indicating that this member is a field. (Overrides MemberInfo. . :: . .MemberType.) |
![]() |
Name | Gets the name of the current member. (Inherited from MemberInfo.) |
Top
Methods
Name | Description | |
---|---|---|
![]() |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
GetValue | When overridden in a derived class, returns the value of a field supported by a given object. |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
SetValue | Sets the value of the field supported by the given object. |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
The field information is obtained from metadata. The FieldInfo class does not have a public constructor. FieldInfo objects are obtained by calling either the GetFields or GetField method of a Type object.
Fields are variables defined in the class. FieldInfo provides access to the metadata for a field within a class and provides dynamic set and get functionality for the field. The class is not loaded into memory until invoke or get is called on the object.
Notes to Inheritors
When you inherit from FieldInfo, you must override the following members: GetValue and SetValue.
Thread Safety
This type is thread safe.