Type.GetTypeFromHandle(RuntimeTypeHandle) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した型ハンドルによって参照される型を取得します。
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によって参照される型。または、handleのValueプロパティが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
注釈
ハンドルは、取得されたアプリケーション ドメインでのみ有効です。