TypeIdentifierAttribute Clase
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Proporciona compatibilidad con la equivalencia de tipos.
public ref class TypeIdentifierAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed class TypeIdentifierAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class TypeIdentifierAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)>]
type TypeIdentifierAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type TypeIdentifierAttribute = class
inherit Attribute
Public NotInheritable Class TypeIdentifierAttribute
Inherits Attribute
- Herencia
- Atributos
Comentarios
Los compiladores emiten principalmente el TypeIdentifierAttribute atributo . Responde a dos propósitos:
Para todos los tipos importados, indica que el tipo está pensado para usarse para la equivalencia de tipos.
Para los tipos que no tienen GUID en su biblioteca de tipos, tiene un constructor que toma dos cadenas (
scopeyidentifier). Se combinan en un GUID y se convierten en la clave que se usa para la equivalencia de tipos.
La equivalencia de tipos se describe en el Type.IsEquivalentTo tema.
Constructores
| Nombre | Description |
|---|---|
| TypeIdentifierAttribute() |
Crea una nueva instancia de la TypeIdentifierAttribute clase . |
| TypeIdentifierAttribute(String, String) |
Crea una nueva instancia de la TypeIdentifierAttribute clase con el ámbito y el identificador especificados. |
Propiedades
| Nombre | Description |
|---|---|
| Identifier |
Obtiene el valor del |
| Scope |
Obtiene el valor del |
| TypeId |
Cuando se implementa en una clase derivada, obtiene un identificador único para este Attribute. (Heredado de Attribute) |
Métodos
| Nombre | Description |
|---|---|
| Equals(Object) |
Devuelve un valor que indica si esta instancia es igual a un objeto especificado. (Heredado de Attribute) |
| GetHashCode() |
Devuelve el código hash de esta instancia. (Heredado de Attribute) |
| GetType() |
Obtiene el Type de la instancia actual. (Heredado de Object) |
| IsDefaultAttribute() |
Cuando se reemplaza en una clase derivada, indica si el valor de esta instancia es el valor predeterminado de la clase derivada. (Heredado de Attribute) |
| Match(Object) |
Cuando se reemplaza en una clase derivada, devuelve un valor que indica si esta instancia es igual a un objeto especificado. (Heredado de Attribute) |
| MemberwiseClone() |
Crea una copia superficial del Objectactual. (Heredado de Object) |
| ToString() |
Devuelve una cadena que representa el objeto actual. (Heredado de Object) |
Implementaciones de interfaz explícitas
| Nombre | Description |
|---|---|
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío. (Heredado de Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera la información de tipo de un objeto, que se puede usar para obtener la información de tipo de una interfaz. (Heredado de Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 1). (Heredado de Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Proporciona acceso a propiedades y métodos expuestos por un objeto . (Heredado de Attribute) |