C# Class System.Reflection.MethodBase

Inheritance: MemberInfo
Mostra file Open project: kswoll/WootzJs Class Usage Examples

Protected Properties

Property Type Description
methodAttributes MethodAttributes

Private Properties

Property Type Description
GetParametersNoCopy System.Reflection.ParameterInfo[]

Public Methods

Method Description
GetCurrentMethod ( ) : MethodBase

Returns a MethodBase object representing the currently executing method.

GetGenericArguments ( ) : System.Type[]

Returns an array of T:System.Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition.

GetMethodFromHandle ( RuntimeMethodHandle handle ) : MethodBase

Gets method information by using the method's internal metadata representation (handle).

GetMethodFromHandle ( RuntimeMethodHandle handle, RuntimeTypeHandle declaringType ) : MethodBase

Gets a T:System.Reflection.MethodBase object for the constructor or method represented by the specified handle, for the specified generic type.

GetParameters ( ) : System.Reflection.ParameterInfo[]

When overridden in a derived class, gets the parameters of the specified method or constructor.

Invoke ( object obj, BindingFlags invokeAttr, Binder binder, object parameters, CultureInfo culture ) : object

When overridden in a derived class, invokes the reflected method or constructor with the given parameters.

Invoke ( object obj, object parameters ) : object

Invokes the method or constructor represented by the current instance, using the specified parameters.

Protected Methods

Method Description
MethodBase ( string name, ParameterInfo parameters, MethodAttributes methodAttributes, Attribute attributes ) : System.Globalization

Initializes a new instance of the T:System.Reflection.MethodBase class.

Private Methods

Method Description
GetParametersNoCopy ( ) : System.Reflection.ParameterInfo[]

Method Details

GetCurrentMethod() public static method

Returns a MethodBase object representing the currently executing method.
This member was invoked with a late-binding mechanism.
public static GetCurrentMethod ( ) : MethodBase
return MethodBase

GetGenericArguments() public method

Returns an array of T:System.Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition.
The current object is a . Generic constructors are not supported in the .NET Framework version 2.0. This exception is the default behavior if this method is not overridden in a derived class.
public GetGenericArguments ( ) : System.Type[]
return System.Type[]

GetMethodFromHandle() public static method

Gets method information by using the method's internal metadata representation (handle).
is invalid.
public static GetMethodFromHandle ( RuntimeMethodHandle handle ) : MethodBase
handle System.RuntimeMethodHandle The method's handle.
return MethodBase

GetMethodFromHandle() public static method

Gets a T:System.Reflection.MethodBase object for the constructor or method represented by the specified handle, for the specified generic type.
is invalid.
public static GetMethodFromHandle ( RuntimeMethodHandle handle, RuntimeTypeHandle declaringType ) : MethodBase
handle System.RuntimeMethodHandle A handle to the internal metadata representation of a constructor or method.
declaringType System.RuntimeTypeHandle A handle to the generic type that defines the constructor or method.
return MethodBase

GetParameters() public method

When overridden in a derived class, gets the parameters of the specified method or constructor.
public GetParameters ( ) : System.Reflection.ParameterInfo[]
return System.Reflection.ParameterInfo[]

Invoke() public abstract method

When overridden in a derived class, invokes the reflected method or constructor with the given parameters.
The parameter is null and the method is not static.-or- The method is not declared or inherited by the class of . -or-A static constructor is invoked, and is neither null nor an instance of the class that declared the constructor. The type of the parameter does not match the signature of the method or constructor reflected by this instance. The array does not have the correct number of arguments. The invoked method or constructor throws an exception. The caller does not have permission to execute the constructor. The type that declares the method is an open generic type. That is, the property returns true for the declaring type.
public abstract Invoke ( object obj, BindingFlags invokeAttr, Binder binder, object parameters, CultureInfo culture ) : object
obj object The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor.
invokeAttr BindingFlags A bitmask that is a combination of 0 or more bit flags from . If is null, this parameter is assigned the value ; thus, whatever you pass in is ignored.
binder Binder An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If is null, the default binder is used.
parameters object An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.
culture CultureInfo An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.)
return object

Invoke() public method

Invokes the method or constructor represented by the current instance, using the specified parameters.
The parameter is null and the method is not static.-or- The method is not declared or inherited by the class of . -or-A static constructor is invoked, and is neither null nor an instance of the class that declared the constructor. The elements of the array do not match the signature of the method or constructor reflected by this instance. The invoked method or constructor throws an exception. -or-The current instance is a that contains unverifiable code. See the "Verification" section in Remarks for . The array does not have the correct number of arguments. The caller does not have permission to execute the constructor. The type that declares the method is an open generic type. That is, the property returns true for the declaring type. The current instance is a .
public Invoke ( object obj, object parameters ) : object
obj object The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor.
parameters object An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, should be null.If the method or constructor represented by this instance takes a ref parameter (ByRef in Visual Basic), no special attribute is required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.
return object

MethodBase() protected method

Initializes a new instance of the T:System.Reflection.MethodBase class.
protected MethodBase ( string name, ParameterInfo parameters, MethodAttributes methodAttributes, Attribute attributes ) : System.Globalization
name string
parameters ParameterInfo
methodAttributes MethodAttributes
attributes Attribute
return System.Globalization

Property Details

methodAttributes protected_oe property

protected MethodAttributes methodAttributes
return MethodAttributes