Type.GetTypeFromHandle(RuntimeTypeHandle) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém o tipo referenciado pela alavanca de tipo especificada.
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
Parâmetros
- handle
- RuntimeTypeHandle
O objeto que se refere ao tipo.
Devoluções
O tipo referenciado pelo especificado RuntimeTypeHandle, ou null se a Value propriedade de handle for null.
Exceções
É invocado um inicializador de classe que lança uma exceção.
Exemplos
O exemplo seguinte usa o GetTypeFromHandle método para obter um Type objeto a partir de um RuntimeTypeHandle fornecido pelo GetTypeHandle método.
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
Observações
Os handles são válidos apenas no domínio de aplicação onde foram obtidos.