Type.GetTypeFromHandle(RuntimeTypeHandle) Metoda

Definice

Získá typ odkazovaný zadaným popisovačem typu.

public:
 static Type ^ GetTypeFromHandle(RuntimeTypeHandle handle);
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

Parametry

handle
RuntimeTypeHandle

Objekt, který odkazuje na typ.

Návraty

Typ odkazovaný zadaným RuntimeTypeHandlenebo null je-li Value vlastnost handlenullje .

Výjimky

Inicializátor třídy je vyvolán a vyvolá výjimku.

Příklady

Následující příklad používá metodu GetTypeFromHandle k získání Type objektu RuntimeTypeHandle z poskytnuté metody GetTypeHandle .

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

Poznámky

Popisovače jsou platné pouze v doméně aplikace, ve které byly získány.

Platí pro

Viz také