IListSource.GetList 메서드

정의

IList를 직접 구현하지 않는 개체에서 데이터 소스에 바인딩될 수 있는 IList를 반환합니다.

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

반환

해당 개체에서 데이터 소스에 바인딩될 수 있는 IList입니다.

예제

다음 코드 예제를 구현 하는 방법에 설명 합니다 IListSource 인터페이스입니다. EmployeeListSource라는 구성 요소는 GetList 메서드를 구현하여 데이터 바인딩에 대한 IList를 노출합니다. 전체 코드 목록은 방법: IListSource 인터페이스 구현을 참조하세요.

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

적용 대상

추가 정보