LookupBindingPropertiesAttribute クラス

定義

検索ベースのバインディングをサポートするプロパティを指定します。 このクラスは継承できません。

public ref class LookupBindingPropertiesAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class LookupBindingPropertiesAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type LookupBindingPropertiesAttribute = class
    inherit Attribute
Public NotInheritable Class LookupBindingPropertiesAttribute
Inherits Attribute
継承
LookupBindingPropertiesAttribute
属性

次のコード例は、参照ベースのバインドで使用されるプロパティを示しています。

// 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

値の設定を解除する場合を除き、属性には LookupBindingPropertiesAttribute 4 つのメンバーをすべて含める必要があります。 次のコード例は、 コントロールを ComboBox 示しています。

// 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

次のコード例は、コントロールが単純なバインドとリスト バインドの両方をサポートできることを示しています。

// 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

次のコード例は、引数を LookupBindingPropertiesAttribute 指定しないと属性の設定を解除できることを示しています。

// 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

注釈

LookupBindingPropertiesAttributeは、参照ベースのバインディング 、特に ListBox および コントロールで使用されるプロパティをComboBox指定するために使用されます。

LookupBindingPropertiesAttributeはクラス レベルで指定されます。 クラスは継承でき、同じクラスに対して複数の属性を許可しません。

コンストラクター

LookupBindingPropertiesAttribute()

パラメーターを使用せずに LookupBindingPropertiesAttribute クラスの新しいインスタンスを初期化します。

LookupBindingPropertiesAttribute(String, String, String, String)

LookupBindingPropertiesAttribute クラスの新しいインスタンスを初期化します。

フィールド

Default

LookupBindingPropertiesAttribute クラスの既定値を表します。

プロパティ

DataSource

LookupBindingPropertiesAttribute のバインド先となるコンポーネントのデータ ソース プロパティの名前を取得します。

DisplayMember

LookupBindingPropertiesAttribute のバインド先となるコンポーネントの表示メンバー プロパティの名前を取得します。

LookupMember

この属性のバインド先となるコンポーネントの検索メンバーの名前を取得します。

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)
ValueMember

LookupBindingPropertiesAttribute のバインド先となるコンポーネントの値メンバー プロパティの名前を取得します。

メソッド

Equals(Object)

指定した Object が、現在の LookupBindingPropertiesAttribute インスタンスと等しいかどうかを判断します。

GetHashCode()

このインスタンスのハッシュ コードを返します。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

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

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください