Share via


MethodInfo Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Discovers the attributes of a method and provides access to method metadata.

Inheritance Hierarchy

System. . :: . .Object
  System.Reflection. . :: . .MemberInfo
    System.Reflection. . :: . .MethodBase
      System.Reflection..::..MethodInfo

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public MustInherit Class MethodInfo _
    Inherits MethodBase
[SerializableAttribute]
public abstract class MethodInfo : MethodBase
[SerializableAttribute]
public ref class MethodInfo abstract : public MethodBase
[<AbstractClass>]
[<SerializableAttribute>]
type MethodInfo =  
    class
        inherit MethodBase
    end
public abstract class MethodInfo extends MethodBase

The MethodInfo type exposes the following members.

Constructors

  Name Description
Protected method MethodInfo Initializes a new instance of the MethodInfo class.

Top

Properties

  Name Description
Public property DeclaringType Gets the class that declares the current method. (Inherited from MethodBase.)
Public property IsAbstract Gets a value indicating whether the method is abstract. (Inherited from MethodBase.)
Public property IsFinal Gets a value indicating whether this method is final. (Inherited from MethodBase.)
Public property IsPublic Gets a value indicating whether this is a public method. (Inherited from MethodBase.)
Public property IsStatic Gets a value indicating whether the method is static. (Inherited from MethodBase.)
Public property IsVirtual Gets a value indicating whether the method is virtual. (Inherited from MethodBase.)
Public property MemberType Gets a MemberTypes value indicating that this member is a method. (Overrides MemberInfo. . :: . .MemberType.)
Public property Name Gets the name of the current method. (Inherited from MethodBase.)
Public property ReturnType Gets the return type of this method.

Top

Methods

  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Invoke Invokes the method or constructor represented by the current instance, using the specified parameters. (Inherited from MethodBase.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

Instances of MethodInfo are obtained by calling the GetMethods or GetMethod method of a Type object or of an object that derives from Type, or by calling the MakeGenericMethod method of a MethodInfo that represents a generic method definition.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Reflection Namespace