Class MethodBase
- Namespace
- System.Reflection
- Assembly
- mscorlib.dll
Provides information about methods and constructors.
public abstract class MethodBase : MemberInfo
- Inheritance
-
MethodBase
- Derived
- Inherited Members
- Extension Methods
Remarks
Available only in mscorlib build with support for System.Reflection.
Constructors
MethodBase()
protected MethodBase()
Properties
DeclaringType
Gets the class that declares this member.
public override Type DeclaringType { get; }
Property Value
- Type
The Type object for the class that declares this member.
IsAbstract
Gets a value indicating whether the method is abstract
public bool IsAbstract { get; }
Property Value
- bool
true if this method is abstract; otherwise, false.
IsFinal
GGets a value indicating whether the method is final.
public bool IsFinal { get; }
Property Value
- bool
true if this method is final; otherwise, false.
IsPublic
Gets a value indicating whether this is a public method.
public bool IsPublic { get; }
Property Value
- bool
true if this method is public; otherwise, false.
IsStatic
Gets a value indicating whether the method is static.
public bool IsStatic { get; }
Property Value
- bool
true if this method is static; otherwise, false.
IsVirtual
Gets a value indicating whether the method is virtual
public bool IsVirtual { get; }
Property Value
- bool
true if this method is virtual; otherwise, false.
Name
Gets the name of the current member.
public override string Name { get; }
Property Value
- string
A String containing the name of this member.
Methods
GetParameters()
When overridden in a derived class, gets the parameters of the specified method or constructor.
public abstract ParameterInfo[] GetParameters()
Returns
- ParameterInfo[]
An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance.
Invoke(object, object[])
Invokes the method or constructor represented by the current instance, using the specified parameters.
public object Invoke(object obj, object[] parameters)
Parameters
obj
objectThe 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, parameters should be null.
Returns
- object
An object containing the return value of the invoked method, or null in the case of a constructor.