TypeBuilder.DefineField Metoda

Definice

Přidá do dynamického typu nové pole.

Přetížení

DefineField(String, Type, FieldAttributes)

Přidá k typu nové pole se zadaným názvem, atributy a typem pole.

DefineField(String, Type, Type[], Type[], FieldAttributes)

Přidá do typu nové pole s daným názvem, atributy, typem pole a vlastními modifikátory.

DefineField(String, Type, FieldAttributes)

Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs

Přidá k typu nové pole se zadaným názvem, atributy a typem pole.

public:
 System::Reflection::Emit::FieldBuilder ^ DefineField(System::String ^ fieldName, Type ^ type, System::Reflection::FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, System.Reflection.FieldAttributes attributes);
member this.DefineField : string * Type * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineField (fieldName As String, type As Type, attributes As FieldAttributes) As FieldBuilder

Parametry

fieldName
String

Název pole. fieldName nemůže obsahovat vložené hodnoty null.

type
Type

Typ pole

attributes
FieldAttributes

Atributy pole

Návraty

Definované pole.

Výjimky

Délka je fieldName nula.

-nebo-

type je System.Void.

-nebo-

Pro nadřazenou třídu tohoto pole byla zadána celková velikost.

fieldName je null.

Typ byl dříve vytvořen pomocí příkazu CreateType().

Platí pro

DefineField(String, Type, Type[], Type[], FieldAttributes)

Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs

Přidá do typu nové pole s daným názvem, atributy, typem pole a vlastními modifikátory.

public:
 System::Reflection::Emit::FieldBuilder ^ DefineField(System::String ^ fieldName, Type ^ type, cli::array <Type ^> ^ requiredCustomModifiers, cli::array <Type ^> ^ optionalCustomModifiers, System::Reflection::FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
member this.DefineField : string * Type * Type[] * Type[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineField (fieldName As String, type As Type, requiredCustomModifiers As Type(), optionalCustomModifiers As Type(), attributes As FieldAttributes) As FieldBuilder

Parametry

fieldName
String

Název pole. fieldName nemůže obsahovat vložené hodnoty null.

type
Type

Typ pole

requiredCustomModifiers
Type[]

Pole typů představující požadované vlastní modifikátory pole, například IsConstModifier.

optionalCustomModifiers
Type[]

Pole typů představující volitelné vlastní modifikátory pole, například IsConstModifier.

attributes
FieldAttributes

Atributy pole

Návraty

Definované pole.

Výjimky

Délka je fieldName nula.

-nebo-

type je System.Void.

-nebo-

Pro nadřazenou třídu tohoto pole byla zadána celková velikost.

fieldName je null.

Typ byl dříve vytvořen pomocí příkazu CreateType().

Poznámky

Toto přetížení je k dispozici pro návrháře spravovaných kompilátorů.

Platí pro