DefaultBindingPropertyAttribute Classe
Definição
Especifica a propriedade de associação padrão de um componente.Specifies the default binding property for a component. Essa classe não pode ser herdada.This class cannot be inherited.
public ref class DefaultBindingPropertyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class DefaultBindingPropertyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type DefaultBindingPropertyAttribute = class
inherit Attribute
Public NotInheritable Class DefaultBindingPropertyAttribute
Inherits Attribute
- Herança
- Atributos
Exemplos
O exemplo de código a seguir demonstra DefaultBindingPropertyAttribute como usar a classe para especificar a propriedade padrão para vinculação de dados.The following code example demonstrates using the DefaultBindingPropertyAttribute class to specify the default property for data binding. Para obter uma listagem de código completa, consulte como aplicar atributos em controles Windows Forms.For a full code listing, see How to: Apply Attributes in Windows Forms Controls.
// This control demonstrates a simple logging capability.
[ComplexBindingProperties("DataSource", "DataMember")]
[DefaultBindingProperty("TitleText")]
[DefaultEvent("ThresholdExceeded")]
[DefaultProperty("Threshold")]
[HelpKeywordAttribute(typeof(UserControl))]
[ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design")]
public class AttributesDemoControl : UserControl
{
' This control demonstrates a simple logging capability.
<ComplexBindingProperties("DataSource", "DataMember"), _
DefaultBindingProperty("TitleText"), _
DefaultEvent("ThresholdExceeded"), _
DefaultProperty("Threshold"), _
HelpKeywordAttribute(GetType(UserControl)), _
ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design")> _
Public Class AttributesDemoControl
Inherits UserControl
Comentários
O DefaultBindingPropertyAttribute é especificado no nível de classe.The DefaultBindingPropertyAttribute is specified at the class level. Ele pode ser herdado e não permite vários atributos na mesma classe.It can be inherited and does not allow multiple attributes on the same class.
Para obter mais informações sobre como usar atributos, consulte atributos.For more information about using attributes, see Attributes.
Construtores
| DefaultBindingPropertyAttribute() |
Inicializa uma nova instância da classe DefaultBindingPropertyAttribute não usando nenhum parâmetro.Initializes a new instance of the DefaultBindingPropertyAttribute class using no parameters. |
| DefaultBindingPropertyAttribute(String) |
Inicializa uma nova instância da classe DefaultBindingPropertyAttribute usando o nome da propriedade especificado.Initializes a new instance of the DefaultBindingPropertyAttribute class using the specified property name. |
Campos
| Default |
Representa o valor padrão para a classe DefaultBindingPropertyAttribute.Represents the default value for the DefaultBindingPropertyAttribute class. |
Propriedades
| Name |
Obtém o nome da propriedade de associação padrão para o componente ao qual o DefaultBindingPropertyAttribute está associado.Gets the name of the default binding property for the component to which the DefaultBindingPropertyAttribute is bound. |
| TypeId |
Quando implementado em uma classe derivada, obtém um identificador exclusivo para este Attribute.When implemented in a derived class, gets a unique identifier for this Attribute. (Herdado de Attribute) |
Métodos
| Equals(Object) |
Determina se o Object especificado é igual à instância de DefaultBindingPropertyAttribute atual.Determines whether the specified Object is equal to the current DefaultBindingPropertyAttribute instance. |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. |
| 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) |