IListSource.GetList IListSource.GetList IListSource.GetList IListSource.GetList Method

定義

それ自体は IList を実装していないオブジェクトから、データ ソースに連結できる IList を返します。Returns an IList that can be bound to a data source from an object that does not implement an IList itself.

public:
 System::Collections::IList ^ GetList();
public System.Collections.IList GetList ();
abstract member GetList : unit -> System.Collections.IList
Public Function GetList () As IList

戻り値

オブジェクトからデータ ソースに連結できる IListAn IList that can be bound to a data source from the object.

次のコード例は、実装する方法を示します、IListSourceインターフェイス。The following code example demonstrates how to implement the IListSource interface. という名前のコンポーネントEmployeeListSource公開、IList実装することで、データ バインド、GetListメソッド。A component named EmployeeListSource exposes an IList for data binding by implementing the GetList method. 完全なコード一覧については、次を参照してください。方法。IListSource インターフェイスを実装します。For a full code listing, see How to: Implement the IListSource Interface.

System.Collections.IList IListSource.GetList()
{
    BindingList<Employee>   ble = new BindingList<Employee>();

    if (!this.DesignMode)
    {
        ble.Add(new Employee("Aaberg, Jesper", 26000000));
        ble.Add(new Employee("Cajhen, Janko", 19600000));
        ble.Add(new Employee("Furse, Kari", 19000000));
        ble.Add(new Employee("Langhorn, Carl", 16000000));
        ble.Add(new Employee("Todorov, Teodor", 15700000));
        ble.Add(new Employee("Verebélyi, Ágnes", 15700000));
    }

    return ble;
}
Public Function GetList() As System.Collections.IList Implements System.ComponentModel.IListSource.GetList

    Dim ble As New BindingList(Of Employee)

    If Not Me.DesignMode Then
        ble.Add(New Employee("Aaberg, Jesper", 26000000))
        ble.Add(New Employee("Cajhen, Janko", 19600000))
        ble.Add(New Employee("Furse, Kari", 19000000))
        ble.Add(New Employee("Langhorn, Carl", 16000000))
        ble.Add(New Employee("Todorov, Teodor", 15700000))
        ble.Add(New Employee("Verebélyi, Ágnes", 15700000))
    End If

    Return ble

End Function

適用対象

こちらもご覧ください