Adds a new property to the class, with the given name and property signature.
[Visual Basic] Public Function DefineProperty( _ ByVal name As String, _ ByVal attributes As PropertyAttributes, _ ByVal returnType As Type, _ ByVal parameterTypes() As Type, _ ByVal backingField As FieldBuilder _ ) As PropertyBuilder [C#] public PropertyBuilder DefineProperty( string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes, FieldBuilder backingField ); [C++] public: PropertyBuilder* DefineProperty( String* name, PropertyAttributes attributes, Type* returnType, Type* parameterTypes[], FieldBuilder* backingField ); [JScript] public function DefineProperty( name : String, attributes : PropertyAttributes, returnType : Type, parameterTypes : Type[], backingField : FieldBuilder ) : PropertyBuilder;
The defined property.
Exception Type | Condition |
---|---|
ArgumentNullException | if name 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