Defines a global method given its name, attributes, return type, and parameter types.
[Visual Basic] Overloads Public Function DefineGlobalMethod( _ ByVal name As String, _ ByVal attributes As MethodAttributes, _ ByVal returnType As Type, _ ByVal parameterTypes() As Type _ ) As MethodBuilder [C#] public MethodBuilder DefineGlobalMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes ); [C++] public: MethodBuilder* DefineGlobalMethod( String* name, MethodAttributes attributes, Type* returnType, Type* parameterTypes[] ); [JScript] public function DefineGlobalMethod( name : String, attributes : MethodAttributes, returnType : Type, parameterTypes : Type[] ) : MethodBuilder;
Returns the defined global method.
Exception Type | Condition |
---|---|
ArgumentException | if the method is not static |
ArgumentNullException | if name is a null reference (in Visual Basic Nothing) |
InvalidOperationException | if CreateGlobalFunctions has been previously called |
NGWS Runtime Security:
ReflectionPermission | SecurityAction.Demand, ReflectionEmit |
ModuleBuilder Class | ModuleBuilder Members | System.Reflection.Emit Namespace | ModuleBuilder.DefineGlobalMethod Overload List