Search Results for

    Show / Hide Table of Contents

    Class FieldInfo

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

    Inheritance
    object
    MemberInfo
    FieldInfo
    Inherited Members
    MemberInfo.Name
    MemberInfo.DeclaringType
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: System.Reflection
    Assembly: mscorlib.dll
    Syntax
    public abstract class FieldInfo : MemberInfo
    Remarks

    Available only in mscorlib build with support for System.Reflection.

    Constructors

    FieldInfo()

    Declaration
    protected FieldInfo()

    Properties

    FieldType

    Gets the type of this field object.

    Declaration
    public abstract Type FieldType { get; }
    Property Value
    Type Description
    Type

    The type of this field object.

    MemberType

    Gets a MemberTypes value indicating that this member is a field.

    Declaration
    public override MemberTypes MemberType { get; }
    Property Value
    Type Description
    MemberTypes

    A MemberTypes value indicating that this member is a field.

    Overrides
    MemberInfo.MemberType

    Methods

    GetCustomAttributes(bool)

    When overridden in a derived class, returns an array of all custom attributes applied to this member.

    Declaration
    public override object[] GetCustomAttributes(bool inherit)
    Parameters
    Type Name Description
    bool inherit

    true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events.

    Returns
    Type Description
    object[]

    An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.

    Overrides
    MemberInfo.GetCustomAttributes(bool)
    Remarks

    This method ignores the inherit parameter for properties and events.

    GetValue(object)

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

    Declaration
    public abstract 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.

    SetValue(object, object)

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

    Declaration
    public virtual void SetValue(object obj, object value)
    Parameters
    Type Name Description
    object obj

    The object whose field value will be set.

    object value

    The value to assign to the field.

    Extension Methods

    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    LogDispatcher.GetCurrentClassLogger(object)
    In This Article
    Back to top Copyright © 2023 nanoFramework Contributors
    Generated by DocFX