Type.GetTypeFromHandle(RuntimeTypeHandle) メソッド

定義

指定した型ハンドルによって参照される型を取得します。

public:
 static Type ^ GetTypeFromHandle(RuntimeTypeHandle handle);
public static Type GetTypeFromHandle(RuntimeTypeHandle handle);
static member GetTypeFromHandle : RuntimeTypeHandle -> Type
Public Shared Function GetTypeFromHandle (handle As RuntimeTypeHandle) As Type

パラメーター

handle
RuntimeTypeHandle

型を参照するオブジェクト。

返品

指定したRuntimeTypeHandleによって参照される型。または、handleValueプロパティがnull場合にnullします。

例外

クラス初期化子が呼び出され、例外がスローされます。

次の例では、GetTypeFromHandle メソッドを使用して、GetTypeHandle メソッドによって提供されるRuntimeTypeHandleからType オブジェクトを取得します。

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);
let myClass1 = MyClass1()
// Get the type referenced by the specified type handle.
let myClass1Type = Type.GetTypeFromHandle(Type.GetTypeHandle myClass1)
printfn $"The Names of the Attributes: {myClass1Type.Attributes}"
   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

注釈

ハンドルは、取得されたアプリケーション ドメインでのみ有効です。

適用対象

こちらもご覧ください