Adds a new fieldto the class, with the given name, attributes and field type.
[Visual Basic] Public Function DefineField( _ ByVal fieldName As String, _ ByVal type As Type, _ ByVal attributes As FieldAttributes _ ) As FieldBuilder [C#] public FieldBuilder DefineField( string fieldName, Type type, FieldAttributes attributes ); [C++] public: FieldBuilder* DefineField( String* fieldName, Type* type, FieldAttributes attributes ); [JScript] public function DefineField( fieldName : String, type : Type, attributes : FieldAttributes ) : FieldBuilder;
The defined field.
Exception Type | Condition |
---|---|
ArgumentNullException | if fieldName is a null reference (in Visual Basic Nothing) |
InvalidOperationException | if the type was previously created using CreateType |
TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace