IListSource.GetList Yöntem

Tanım

IList Kendisini uygulamayan bir nesneden veri kaynağına bağlanabilen bir IList döndürür.

C#
public System.Collections.IList GetList ();

Döndürülenler

IList nesnesinden bir veri kaynağına bağlanabilen.

Örnekler

Aşağıdaki kod örneğinde arabirimin nasıl uygulandığı gösterilmektedir IListSource . adlı EmployeeListSource bir bileşen, yöntemini uygulayarak bir IList for veri bağlamasını GetList kullanıma sunar. Tam kod listesi için bkz . Nasıl yapılır: IListSource Arabirimini Uygulama.

C#
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;
}

Şunlara uygulanır

Ürün Sürümler
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Ayrıca bkz.