Type.TypeInitializer 属性
定义
获取该类型的初始值设定项。Gets the initializer for the type.
public:
property System::Reflection::ConstructorInfo ^ TypeInitializer { System::Reflection::ConstructorInfo ^ get(); };
public System.Reflection.ConstructorInfo? TypeInitializer { get; }
public System.Reflection.ConstructorInfo TypeInitializer { get; }
[System.Runtime.InteropServices.ComVisible(true)]
public System.Reflection.ConstructorInfo TypeInitializer { get; }
member this.TypeInitializer : System.Reflection.ConstructorInfo
[<System.Runtime.InteropServices.ComVisible(true)>]
member this.TypeInitializer : System.Reflection.ConstructorInfo
Public ReadOnly Property TypeInitializer As ConstructorInfo
属性值
包含 Type 的类构造函数的名称的对象。An object that contains the name of the class constructor for the Type.
实现
- 属性
注解
还可以通过 FindMembers 方法或使用 GetMember GetMembers 作为参数的、、 GetConstructor 和 GetConstructors 方法的重载来使用类初始值设定项 BindingFlags 。Class initializers are also available through the FindMembers method, or through overloads of the GetMember, GetMembers, GetConstructor, and GetConstructors methods that take BindingFlags as a parameter.
如果当前 Type 表示泛型类型或泛型方法的定义中的类型参数,则此属性返回 null 。If the current Type represents a type parameter in the definition of a generic type or generic method, this property returns null.