Type.GetTypeFromHandle 메서드

지정된 형식 핸들이 참조하는 형식을 가져옵니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Shared Function GetTypeFromHandle ( _
    handle As RuntimeTypeHandle _
) As Type
‘사용 방법
Dim handle As RuntimeTypeHandle
Dim returnValue As Type

returnValue = Type.GetTypeFromHandle(handle)
public static Type GetTypeFromHandle (
    RuntimeTypeHandle handle
)
public:
static Type^ GetTypeFromHandle (
    RuntimeTypeHandle handle
)
public static Type GetTypeFromHandle (
    RuntimeTypeHandle handle
)
public static function GetTypeFromHandle (
    handle : RuntimeTypeHandle
) : Type

매개 변수

반환 값

지정된 RuntimeTypeHandle이 참조하는 형식을 반환합니다.

예외

예외 형식 조건

ArgumentNullException

handle이 Null 참조(Visual Basic의 경우 Nothing)인 경우

TargetInvocationException

클래스 이니셜라이저가 호출되고 예외가 throw되는 경우

설명

핸들은 해당 핸들을 얻은 응용 프로그램 도메인에서만 유효합니다.

요청된 형식이 public 형식이 아니고 public 형식이 아닌 개체를 현재 어셈블리의 외부에 리플렉션할 수 있는 ReflectionPermission이 호출자에게 없는 경우 이 메서드는 Null 참조(Visual Basic의 경우 Nothing)를 반환합니다.

예제

   Dim myClass1 As New MyClass1()
   ' Get the type referenced by the specified type handle.
   Dim myClass1Type As Type = Type.GetTypeFromHandle(Type.GetTypeHandle(MyClass1))
   Console.WriteLine(("The Names of the Attributes :" + myClass1Type.Attributes.ToString()))
End Sub 'Main 
MyClass1 myClass1 = new MyClass1();
 // Get the type referenced by the specified type handle.
Type myClass1Type = Type.GetTypeFromHandle(Type.GetTypeHandle(myClass1));
Console.WriteLine("The Names of the Attributes :"+myClass1Type.Attributes);
MyClass1^ myClass1 = gcnew MyClass1;
// Get the type referenced by the specified type handle.
Type^ myClass1Type = Type::GetTypeFromHandle( Type::GetTypeHandle( myClass1 ) );
Console::WriteLine( "The Names of the Attributes : {0}", myClass1Type->Attributes );
MyClass1 myClass1 =  new MyClass1();
// Get the type referenced by the specified type handle.
Type myClass1Type = Type.GetTypeFromHandle(Type.GetTypeHandle(myClass1));
Console.WriteLine("The Names of the Attributes :" + myClass1Type.
    get_Attributes());

.NET Framework 보안

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Type 클래스
Type 멤버
System 네임스페이스
RuntimeTypeHandle 구조체
TypeHandle
GetTypeHandle
ReflectionPermission