TypeBuilder.DefineFieldCore 方法

定義

在衍生類別中覆寫時,使用指定的名稱、屬性、欄位類型和自訂修飾詞,將新的欄位新增至類型。

protected:
 abstract System::Reflection::Emit::FieldBuilder ^ DefineFieldCore(System::String ^ fieldName, Type ^ type, cli::array <Type ^> ^ requiredCustomModifiers, cli::array <Type ^> ^ optionalCustomModifiers, System::Reflection::FieldAttributes attributes);
protected abstract System.Reflection.Emit.FieldBuilder DefineFieldCore (string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
abstract member DefineFieldCore : string * Type * Type[] * Type[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Protected MustOverride Function DefineFieldCore (fieldName As String, type As Type, requiredCustomModifiers As Type(), optionalCustomModifiers As Type(), attributes As FieldAttributes) As FieldBuilder

參數

fieldName
String

欄位的名稱。 fieldName 不能包含內嵌的 null。

type
Type

欄位的型別。

requiredCustomModifiers
Type[]

型別的陣列,表示欄位所需的自訂修飾詞。

optionalCustomModifiers
Type[]

類型的陣列,表示欄位的選擇性自訂修飾詞。

attributes
FieldAttributes

列舉值的位元組合,指定欄位的屬性。

傳回

定義的欄位。

適用於