DesignerSerializerAttribute Classe
Definição
Indica um serializador para o gerenciador de serialização a ser usado para serializar os valores do tipo ao qual esse atributo é aplicado.Indicates a serializer for the serialization manager to use to serialize the values of the type this attribute is applied to. Essa classe não pode ser herdada.This class cannot be inherited.
public ref class DesignerSerializerAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true, Inherited=true)]
public sealed class DesignerSerializerAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true, Inherited=true)>]
type DesignerSerializerAttribute = class
inherit Attribute
Public NotInheritable Class DesignerSerializerAttribute
Inherits Attribute
- Herança
- Atributos
Exemplos
O código a seguir usa um DesignerSerializerAttribute para associar um serializador de exemplo com um componente de exemplo.The following code uses a DesignerSerializerAttribute to associate an example serializer with an example component.
[DesignerSerializerAttribute(ExampleSerializer::typeid,CodeDomSerializer::typeid)]
public ref class ExampleControl: public UserControl
{
public:
ExampleControl()
{
}
};
[DesignerSerializerAttribute(typeof(ExampleSerializer), typeof(CodeDomSerializer))]
public class ExampleControl : System.Windows.Forms.UserControl
{
public ExampleControl()
{
}
}
<DesignerSerializerAttribute(GetType(ExampleSerializer), GetType(CodeDomSerializer))> _
Public Class ExampleControl
Inherits System.Windows.Forms.UserControl
Public Sub New()
End Sub
End Class
Comentários
DesignerSerializerAttribute fornece uma maneira de indicar ao Gerenciador de serialização de designer que um tipo específico de serializador deve ser usado ao serializar os valores de um objeto.DesignerSerializerAttribute provides a way to indicate to the designer serialization manager that a specific type of serializer should be used when serializing the values of an object. Isso permite que você especifique um serializador que seja capaz de serializar um tipo personalizado, por exemplo.This allows you to specify a serializer that is capable of serializing a custom type, for instance. Coloque esse atributo em uma classe para indicar o objeto de serialização a ser usado ao serializar a classe.Place this attribute on a class to indicate the serialization object to use when serializing the class.
Construtores
| DesignerSerializerAttribute(String, String) |
Inicializa uma nova instância da classe DesignerSerializerAttribute.Initializes a new instance of the DesignerSerializerAttribute class. |
| DesignerSerializerAttribute(String, Type) |
Inicializa uma nova instância da classe DesignerSerializerAttribute.Initializes a new instance of the DesignerSerializerAttribute class. |
| DesignerSerializerAttribute(Type, Type) |
Inicializa uma nova instância da classe DesignerSerializerAttribute.Initializes a new instance of the DesignerSerializerAttribute class. |
Propriedades
| SerializerBaseTypeName |
Obtém o nome totalmente qualificado do tipo base do serializador.Gets the fully qualified type name of the serializer base type. |
| SerializerTypeName |
Obtém o nome totalmente qualificado do serializador.Gets the fully qualified type name of the serializer. |
| TypeId |
Indica uma ID exclusiva para este tipo de atributo.Indicates a unique ID for this attribute type. |
Métodos
| Equals(Object) |
Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Herdado de Attribute) |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. (Herdado de Attribute) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| IsDefaultAttribute() |
Quando substituído em uma classe derivada, indica se o valor dessa instância é o valor padrão para a classe derivada.When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Herdado de Attribute) |
| Match(Object) |
Quando substituído em uma classe derivada, retorna um valor que indica se essa instância é igual a um objeto especificado.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Herdado de Attribute) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
Implantações explícitas de interface
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações de tipo para um objeto, que pode ser usado para obter as informações de tipo para uma interface.Retrieves the type information for an object, which can be used to get the type information for an interface. (Herdado de Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de Attribute) |