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 구성 요소는 메서드를 IList 구현하여 데이터 바인딩을 노출합니다 GetList . 전체 코드 목록은 방법: IListSource 인터페이스 구현을 참조하세요.

System.Collections.IList IListSource.GetList()
{
    BindingList<Employee> ble = DesignMode
    ? []
    : [
        new("Aaberg, Jesper", 26000000),
        new ("Aaberg, Jesper", 26000000),
        new ("Cajhen, Janko", 19600000),
        new ("Furse, Kari", 19000000),
        new ("Langhorn, Carl", 16000000),
        new ("Todorov, Teodor", 15700000),
        new ("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

적용 대상

추가 정보