LookupBindingPropertiesAttribute LookupBindingPropertiesAttribute LookupBindingPropertiesAttribute LookupBindingPropertiesAttribute Class

Definición

Especifica las propiedades que admiten el enlace basado en búsqueda. Specifies the properties that support lookup-based binding. Esta clase no puede heredarse. This class cannot be inherited.

public ref class LookupBindingPropertiesAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class LookupBindingPropertiesAttribute : Attribute
type LookupBindingPropertiesAttribute = class
    inherit Attribute
Public NotInheritable Class LookupBindingPropertiesAttribute
Inherits Attribute
Herencia
LookupBindingPropertiesAttributeLookupBindingPropertiesAttributeLookupBindingPropertiesAttributeLookupBindingPropertiesAttribute
Atributos

Ejemplos

El ejemplo de código siguiente muestra las propiedades usadas con enlace basado en búsqueda.The following code example shows properties used with lookup-based binding.

// The DemoControl class shows properties 
// used with lookup-based binding.
[LookupBindingProperties(
    "DataSource", 
    "DisplayMember", 
    "ValueMember", 
    "LookupMember")]
public class DemoControl : Control
{   
}
' The DemoControl class shows properties 
' used with lookup-based binding.
<LookupBindingProperties( _
"DataSource", _
"DisplayMember", _
"ValueMember", _
"LookupMember")> _
Public Class DemoControl
    Inherits Control
End Class

El LookupBindingPropertiesAttribute atributo debe incluir todos los miembros de cuatro, excepto cuando los valores no estén establecidos.The LookupBindingPropertiesAttribute attribute must include all four members, except when unsetting values. El siguiente ejemplo de código muestra la ComboBox control.The following code example shows the ComboBox control.

// The DemoComboBox control shows a standard
// combo box binding definition.
[LookupBindingProperties(
    "DataSource", 
    "DisplayMember", 
    "ValueMember", 
    "SelectedValue")]
public class DemoComboBox : Control
{
}
' The DemoComboBox control shows a standard
' combo box binding definition.
<LookupBindingProperties( _
"DataSource", _
"DisplayMember", _
"ValueMember", _
"SelectedValue")> _
Public Class DemoComboBox
    Inherits Control
End Class

El ejemplo de código siguiente se muestra que un control puede admitir tanto un enlace simple como enlace a la lista.The following code example shows that a control can support both simple binding as well as list binding.

// The DemoComboBox2 class shows that a control can
// support both simple binding as well as list binding.
[LookupBindingProperties(
    "DataSource", 
    "DisplayMember", 
    "ValueMember", 
    "SelectedValue")]
[DefaultBindingProperty("Text")]
public class DemoComboBox2 : Control 
{
}
' The DemoComboBox2 class shows that a control can
' support both simple binding as well as list binding.
<LookupBindingProperties( _
"DataSource", _
"DisplayMember", _
"ValueMember", _
"SelectedValue"), _
DefaultBindingProperty("Text")> _
Public Class DemoComboBox2
    Inherits Control
End Class

En el ejemplo de código siguiente se muestra que el LookupBindingPropertiesAttribute atributo lo pueden anular mediante la especificación de ningún argumento.The following code example shows that the LookupBindingPropertiesAttribute attribute can be unset by specifying no arguments.

// NonBindableCombo control shows how to unset the
// LookupBindingProperties by specifying no arguments.
[LookupBindingProperties()]
public class NonBindableCombo : Control
{
}
' NonBindableCombo control shows how to unset the
' LookupBindingProperties by specifying no arguments.
<LookupBindingProperties()>  _
Public Class NonBindableCombo
    Inherits Control
End Class

Comentarios

El LookupBindingPropertiesAttribute se usa para especificar las propiedades utilizadas con el enlace basado en búsquedas, especialmente ListBox y ComboBox controles.The LookupBindingPropertiesAttribute is used to specify the properties used with lookup-based binding, particularly ListBox and ComboBox controls.

El LookupBindingPropertiesAttribute se especifica en el nivel de clase.The LookupBindingPropertiesAttribute is specified at the class level. La clase se puede heredar y no admite varios atributos en la misma clase.The class can be inherited and does not allow multiple attributes on the same class.

Constructores

LookupBindingPropertiesAttribute() LookupBindingPropertiesAttribute() LookupBindingPropertiesAttribute() LookupBindingPropertiesAttribute()

Inicializa una nueva instancia de la clase LookupBindingPropertiesAttribute sin ningún parámetro. Initializes a new instance of the LookupBindingPropertiesAttribute class using no parameters.

LookupBindingPropertiesAttribute(String, String, String, String) LookupBindingPropertiesAttribute(String, String, String, String) LookupBindingPropertiesAttribute(String, String, String, String) LookupBindingPropertiesAttribute(String, String, String, String)

Inicializa una nueva instancia de la clase LookupBindingPropertiesAttribute. Initializes a new instance of the LookupBindingPropertiesAttribute class.

Campos

Default Default Default Default

Representa el valor predeterminado de la clase LookupBindingPropertiesAttribute. Represents the default value for the LookupBindingPropertiesAttribute class.

Propiedades

DataSource DataSource DataSource DataSource

Obtiene el nombre de la propiedad de origen de datos del componente al que está enlazado el atributo LookupBindingPropertiesAttribute. Gets the name of the data source property for the component to which the LookupBindingPropertiesAttribute is bound.

DisplayMember DisplayMember DisplayMember DisplayMember

Obtiene el nombre de la propiedad de miembro de presentación del componente al que está enlazado el objeto LookupBindingPropertiesAttribute. Gets the name of the display member property for the component to which the LookupBindingPropertiesAttribute is bound.

LookupMember LookupMember LookupMember LookupMember

Obtiene el nombre del miembro de búsqueda del componente al que está enlazado este atributo. Gets the name of the lookup member for the component to which this attribute is bound.

TypeId TypeId TypeId TypeId

Cuando se implementa en una clase derivada, obtiene un identificador único para este Attribute. When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)
ValueMember ValueMember ValueMember ValueMember

Obtiene el nombre de la propiedad de miembro de valor del componente al que está enlazado el objeto LookupBindingPropertiesAttribute. Gets the name of the value member property for the component to which the LookupBindingPropertiesAttribute is bound.

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto Object especificado es igual a la instancia actual del objeto LookupBindingPropertiesAttribute. Determines whether the specified Object is equal to the current LookupBindingPropertiesAttribute instance.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Devuelve el código hash de esta instancia. Returns the hash code for this instance.

GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual. Gets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute()

Si se reemplaza en una clase derivada, indica si el valor de esta instancia es el valor predeterminado de la clase derivada. When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object) Match(Object) Match(Object) Match(Object)

Cuando se invalida en una clase derivada, devuelve un valor que indica si esta instancia es igual a un objeto especificado. When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del Object actual. Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual. Returns a string that represents the current object.

(Inherited from Object)

Implementaciones de interfaz explícitas

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío. Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Obtiene la información de tipos de un objeto, que puede utilizarse para obtener la información de tipos de una interfaz. Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32)

Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 1). Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Proporciona acceso a las propiedades y los métodos expuestos por un objeto. Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

Se aplica a

Consultar también