Export (0) Print
Expand All

MethodBase.GetMethodFromHandle Method (RuntimeMethodHandle, RuntimeTypeHandle)

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

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

[ComVisibleAttribute(false)]
public static MethodBase GetMethodFromHandle(
	RuntimeMethodHandle handle,
	RuntimeTypeHandle declaringType
)

Parameters

handle
Type: System.RuntimeMethodHandle

A handle to the internal metadata representation of a constructor or method.

declaringType
Type: System.RuntimeTypeHandle

A handle to the generic type that defines the constructor or method.

Return Value

Type: System.Reflection.MethodBase
A MethodBase object representing the method or constructor specified by handle, in the generic type specified by declaringType.

ExceptionCondition
ArgumentException

handle is invalid.

Handles are valid only in the application domain in which they were obtained.

A RuntimeMethodHandle structure for a constructor or method of a generic type can represent different MethodBase objects, depending on the types specified for the type parameters of the generic type. For example, if class G<T> (class G(Of T) in Visual Basic, generic <T> ref class G in C++) has a method that returns type T, the MethodBase object for that method in a constructed class such as G<int> is different from the MethodBase object for that method in the generic type definition.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft