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

屬性值

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 表示泛型型別或泛型方法定義中的類型參數,則這個屬性會傳回 nullIf the current Type represents a type parameter in the definition of a generic type or generic method, this property returns null.

適用於

另請參閱