Adds a new method to the class, with the given name and method signature.
[Visual Basic] Overloads Public Function DefineMethod( _ ByVal name As String, _ ByVal attributes As MethodAttributes, _ ByVal returnType As Type, _ ByVal parameterTypes() As Type _ ) As MethodBuilder [C#] public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes ); [C++] public: MethodBuilder* DefineMethod( String* name, MethodAttributes attributes, Type* returnType, Type* parameterTypes[] ); [JScript] public function DefineMethod( name : String, attributes : MethodAttributes, returnType : Type, parameterTypes : Type[] ) : MethodBuilder;
The defined method.
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 | TypeBuilder.DefineMethod Overload List