JSFieldInfo 类

定义

包装 FieldInfo 对象。Wraps a FieldInfo object.

此 API 支持产品基础结构,不能在代码中直接使用。

public ref class JSFieldInfo sealed : System::Reflection::FieldInfo
public sealed class JSFieldInfo : System.Reflection.FieldInfo
type JSFieldInfo = class
    inherit FieldInfo
Public NotInheritable Class JSFieldInfo
Inherits FieldInfo
继承

属性

Attributes

获取与此字段关联的属性。Gets the attributes that are associated with this field.

CustomAttributes

获取包含此成员自定义属性的集合。Gets a collection that contains this member's custom attributes.

(继承自 MemberInfo)
DeclaringType

获取声明此字段的类型。Gets the type that declares this field.

FieldHandle

获取此字段的内部元数据表示形式的句柄。Gets a handle to the internal metadata representation of this field.

FieldType

获取此字段的类型。Gets the type of this field.

IsAssembly

获取一个值,该值指示此字段的潜在可见性是否由 Assembly 描述;也就是说,此字段只对同一程序集中的其他类型可见,而对该程序集以外的派生类型则不可见。Gets a value indicating whether the potential visibility of this field is described by 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.

(继承自 FieldInfo)
IsCollectible

获取一个值,该值指示此 MemberInfo 对象是否是包含在可回收的 AssemblyLoadContext 中的程序集的一部分。Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext.

(继承自 MemberInfo)
IsFamily

获取一个值,该值指示此字段的可见性是否由 Family 描述;也就是说,此字段仅在其类和派生类内可见。Gets a value indicating whether the visibility of this field is described by Family; that is, the field is visible only within its class and derived classes.

(继承自 FieldInfo)
IsFamilyAndAssembly

获取一个值,该值指示此字段的可见性是否由 FamANDAssem 描述;也就是说,可从派生类访问此字段,但仅当这些派生类在同一程序集中时。Gets a value indicating whether the visibility of this field is described by FamANDAssem; that is, the field can be accessed from derived classes, but only if they are in the same assembly.

(继承自 FieldInfo)
IsFamilyOrAssembly

获取一个值,该值指示此字段的潜在可见性是否由 FamORAssem 描述;也就是说,可通过派生类(无论其位置如何)和同一程序集中的类访问此字段。Gets a value indicating whether the potential visibility of this field is described by FamORAssem; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly.

(继承自 FieldInfo)
IsInitOnly

获取一个值,通过该值指示此字段是否只能在构造函数的主体中设置。Gets a value indicating whether the field can only be set in the body of the constructor.

(继承自 FieldInfo)
IsLiteral

获取一个值,通过该值指示该值是否在编译时写入并且不能更改。Gets a value indicating whether the value is written at compile time and cannot be changed.

(继承自 FieldInfo)
IsNotSerialized

获取一个值,通过该值指示此字段是否有 NotSerialized 特性。Gets a value indicating whether this field has the NotSerialized attribute.

(继承自 FieldInfo)
IsPinvokeImpl

获取一个值,该值指示是否已在 PinvokeImpl 中设置相应的 FieldAttributes 特性。Gets a value indicating whether the corresponding PinvokeImpl attribute is set in FieldAttributes.

(继承自 FieldInfo)
IsPrivate

获取一个值,通过该值指示此字段是否为私有字段。Gets a value indicating whether the field is private.

(继承自 FieldInfo)
IsPublic

获取一个值,通过该值指示此字段是否为公共字段。Gets a value indicating whether the field is public.

(继承自 FieldInfo)
IsSecurityCritical

获取一个值,该值指示当前字段在当前信任级别上是安全关键的还是安全可靠关键的。Gets a value that indicates whether the current field is security-critical or security-safe-critical at the current trust level.

(继承自 FieldInfo)
IsSecuritySafeCritical

获取一个值,该值指示当前字段在当前信任级别上是否是安全可靠关键的。Gets a value that indicates whether the current field is security-safe-critical at the current trust level.

(继承自 FieldInfo)
IsSecurityTransparent

获取一个值,该值指示当前字段在当前信任级别上是否是透明的。Gets a value that indicates whether the current field is transparent at the current trust level.

(继承自 FieldInfo)
IsSpecialName

获取一个值,该值指示是否已在 SpecialName 枚举数中设置相应的 FieldAttributes 特性。Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttributes enumerator.

(继承自 FieldInfo)
IsStatic

获取一个值,通过该值指示此字段是否为静态字段。Gets a value indicating whether the field is static.

(继承自 FieldInfo)
MemberType

获取此字段所充当成员的类型。Gets the type of member that this field is. 标识派生自 MemberInfo(此类从中派生)的类的类型。Identifies the type of class derived from MemberInfo that this class derives from.

MetadataToken

获取一个值,该值标识元数据元素。Gets a value that identifies a metadata element.

(继承自 MemberInfo)
Module

获取一个模块,在该模块中已经定义一个类型,该类型用于声明由当前 MemberInfo 表示的成员。Gets the module in which the type that declares the member represented by the current MemberInfo is defined.

(继承自 MemberInfo)
Name

获取此字段的名称。Gets the name of this field.

ReflectedType

通过反射获取用于获取此实例的类对象。Gets the class object that was used to obtain this instance through reflection.

方法

Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

(继承自 FieldInfo)
GetCustomAttributes(Boolean)

返回一个数组,其中包含附加到此字段的自定义特性。Returns an array that contains the custom attributes that are attached to this field.

GetCustomAttributes(Type, Boolean)

返回一个数组,其中包含附加到此字段的自定义特性(只搜索指定类型的特性)。Returns an array that contains the custom attributes that are attached to this field, searching only for attributes of the specified type.

GetCustomAttributesData()

返回 CustomAttributeData 对象列表,这些对象表示已应用到目标成员的特性相关数据。Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

(继承自 MemberInfo)
GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

(继承自 FieldInfo)
GetOptionalCustomModifiers()

获取一个类型数组,这些类型标识字段的可选自定义修饰符。Gets an array of types that identify the optional custom modifiers of the field.

(继承自 FieldInfo)
GetRawConstantValue()

由编译器返回与字段关联的文本值。Returns a literal value associated with the field by a compiler.

(继承自 FieldInfo)
GetRequiredCustomModifiers()

获取一个类型数组,这些类型标识属性所需的自定义修饰符。Gets an array of types that identify the required custom modifiers of the property.

(继承自 FieldInfo)
GetType() (继承自 FieldInfo)
GetValue(Object)

获取字段的值。Gets the value of the field.

GetValueDirect(TypedReference)

返回给定对象所支持的字段的值。Returns the value of a field supported by a given object.

(继承自 FieldInfo)
HasSameMetadataDefinitionAs(MemberInfo) (继承自 MemberInfo)
IsDefined(Type, Boolean)

确定指定的特性类型是否附加到此字段。Determines whether the specified attribute type is attached to this field.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetValue(Object, Object)

使用指定值设置字段的值。Sets the value of the field, using the specified value.

SetValue(Object, Object, BindingFlags, Binder, CultureInfo)

使用指定的值、区域性和绑定信息设置字段的值。Sets the value of the field, using the specified value, culture, and binding information.

SetValueDirect(TypedReference, Object)

设置给定对象支持的字段的值。Sets the value of the field supported by the given object.

(继承自 FieldInfo)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

_FieldInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(继承自 FieldInfo)
_FieldInfo.GetType()

获取表示 Type 类型的 FieldInfo 对象。Gets a Type object representing the FieldInfo type.

(继承自 FieldInfo)
_FieldInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can then be used to get the type information for an interface.

(继承自 FieldInfo)
_FieldInfo.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(继承自 FieldInfo)
_FieldInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(继承自 FieldInfo)
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(继承自 MemberInfo)
_MemberInfo.GetType()

获取一个表示 Type 类的 MemberInfo 对象。Gets a Type object representing the MemberInfo class.

(继承自 MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can then be used to get the type information for an interface.

(继承自 MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(继承自 MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(继承自 MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Boolean) (继承自 MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) (继承自 MemberInfo)
ICustomAttributeProvider.IsDefined(Type, Boolean) (继承自 MemberInfo)

扩展方法

GetCustomAttribute(MemberInfo, Type)

检索应用于指定成员的指定类型的自定义特性。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute(MemberInfo, Type, Boolean)

检索应用于指定成员的指定类型的自定义特性,并可选择检查该成员的上级。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttribute<T>(MemberInfo)

检索应用于指定成员的指定类型的自定义特性。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute<T>(MemberInfo, Boolean)

检索应用于指定成员的指定类型的自定义特性,并可选择检查该成员的上级。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo)

检索应用于指定成员的自定义特性集合。Retrieves a collection of custom attributes that are applied to a specified member.

GetCustomAttributes(MemberInfo, Boolean)

检索应用于指定成员的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo, Type)

检索应用于指定成员的指定类型的自定义特性集合。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes(MemberInfo, Type, Boolean)

检索应用于指定成员的指定类型的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes<T>(MemberInfo)

检索应用于指定成员的指定类型的自定义特性集合。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes<T>(MemberInfo, Boolean)

检索应用于指定成员的指定类型的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

IsDefined(MemberInfo, Type)

确定是否将指定类型的任何自定义属性应用于指定的成员。Indicates whether custom attributes of a specified type are applied to a specified member.

IsDefined(MemberInfo, Type, Boolean)

指示一个指定类型的自定义特性是否应用于一个指定的数字,并选择性地应用于其的上级。Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

适用于

另请参阅