TypeBuilder.DefineField Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Új mezőt ad hozzá a dinamikus típushoz.
Túlterhelések
| Name | Description |
|---|---|
| DefineField(String, Type, FieldAttributes) |
Új mezőt ad hozzá a típushoz a megadott névvel, attribútumokkal és mezőtípussal. |
| DefineField(String, Type, Type[], Type[], FieldAttributes) |
Új mezőt ad hozzá a típushoz a megadott névvel, attribútumokkal, mezőtípussal és egyéni módosítókkal. |
DefineField(String, Type, FieldAttributes)
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
Új mezőt ad hozzá a típushoz a megadott névvel, attribútumokkal és mezőtípussal.
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
Paraméterek
- fieldName
- String
A mező neve.
fieldName nem tartalmazhat beágyazott null értékeket.
- type
- Type
A mező típusa.
- attributes
- FieldAttributes
A mező attribútumai.
Válaszok
A megadott mező.
Kivételek
A hossz fieldName nulla.
-vagy-
type a System.Void.
-vagy-
A mező szülőosztályához teljes méret lett megadva.
fieldName az null.
A típus korábban a következővel lett létrehozva CreateType(): .
A következőre érvényes:
DefineField(String, Type, Type[], Type[], FieldAttributes)
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
- Forrás:
- TypeBuilder.cs
Új mezőt ad hozzá a típushoz a megadott névvel, attribútumokkal, mezőtípussal és egyéni módosítókkal.
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
Paraméterek
- fieldName
- String
A mező neve.
fieldName nem tartalmazhat beágyazott null értékeket.
- type
- Type
A mező típusa.
- requiredCustomModifiers
- Type[]
A mezőhöz szükséges egyéni módosítókat képviselő típusok tömbje, például IsConstModifier.
- optionalCustomModifiers
- Type[]
A mező opcionális egyéni módosítóit képviselő típusok tömbje, például IsConstModifier.
- attributes
- FieldAttributes
A mező attribútumai.
Válaszok
A megadott mező.
Kivételek
A hossz fieldName nulla.
-vagy-
type a System.Void.
-vagy-
A mező szülőosztályához teljes méret lett megadva.
fieldName az null.
A típus korábban a következővel lett létrehozva CreateType(): .
Megjegyzések
Ez a túlterhelés a felügyelt fordítók tervezői számára biztosított.