TypeBuilder.DefineField Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přidá do dynamického typu nové pole.
Přetížení
| Name | Description |
|---|---|
| DefineField(String, Type, FieldAttributes) |
Přidá do typu nové pole s daný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
- Zdroj:
- TypeBuilder.cs
- Zdroj:
- TypeBuilder.cs
Přidá do typu nové pole s daný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 fieldName je 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í CreateType().
Platí pro
DefineField(String, Type, Type[], Type[], FieldAttributes)
- Zdroj:
- TypeBuilder.cs
- Zdroj:
- TypeBuilder.cs
- 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ích požadované vlastní modifikátory pole, například IsConstModifier.
- optionalCustomModifiers
- Type[]
Pole typů představujících volitelné vlastní modifikátory pole, například IsConstModifier.
- attributes
- FieldAttributes
Atributy pole.
Návraty
Definované pole.
Výjimky
Délka fieldName je 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í CreateType().
Poznámky
Toto přetížení je poskytováno pro návrháře spravovaných kompilátorů.