ITypedList.GetItemProperties(PropertyDescriptor[]) Metódus

Definíció

PropertyDescriptorCollection Az adatok kötéséhez használt egyes elemek tulajdonságait képviselő tulajdonságokat adja vissza.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties(cli::array <System::ComponentModel::PropertyDescriptor ^> ^ listAccessors);
public System.ComponentModel.PropertyDescriptorCollection GetItemProperties(System.ComponentModel.PropertyDescriptor[]? listAccessors);
public System.ComponentModel.PropertyDescriptorCollection GetItemProperties(System.ComponentModel.PropertyDescriptor[] listAccessors);
abstract member GetItemProperties : System.ComponentModel.PropertyDescriptor[] -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetItemProperties (listAccessors As PropertyDescriptor()) As PropertyDescriptorCollection

Paraméterek

listAccessors
PropertyDescriptor[]

A gyűjteményben kötéssel keresendő objektumok tömbje PropertyDescriptor . Ez lehet null.

Válaszok

Az PropertyDescriptorCollection adatok kötéséhez használt egyes elemek tulajdonságai.

Példák

Az alábbi példakód bemutatja, hogyan implementálhatja a metódust GetItemProperties . A teljes kódlistát az ITypedList-felület implementálása című témakörben találhatja meg.

public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
{
    PropertyDescriptorCollection pdc;

    if (listAccessors != null && listAccessors.Length > 0)
    {
        // Return child list shape.
        pdc = ListBindingHelper.GetListItemProperties(listAccessors[0].PropertyType);
    }
    else
    {
        // Return properties in sort order.
        pdc = properties;
    }

    return pdc;
}
Public Function GetItemProperties(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ITypedList.GetItemProperties

    Dim pdc As PropertyDescriptorCollection

    If (Not (listAccessors Is Nothing)) And (listAccessors.Length > 0) Then
        ' Return child list shape
        pdc = ListBindingHelper.GetListItemProperties(listAccessors(0).PropertyType)
    Else
        ' Return properties in sort order
        pdc = properties
    End If

    Return pdc

End Function

Megjegyzések

Ha a listAccessors paraméter nem null, általában tartalmaz egy tulajdonságleírót, amely azonosítja a megvalósító objektumhoz lekérendő tárolók ITypedListlistáját. Például egy DataSet két táblát tartalmazó táblát, myCustomers és myOrdersa köztük található kapcsolat neve myCustOrders. Ha létrehoz egy DataView megtekinteni myCustomerskívánt objektumot, akkor a GetItemProperties metódus meghívása null a függvény oszlopainak myCustomerstulajdonságleíróit adja vissza. Ennek eredményeképpen az egyik visszaadott tulajdonságleíró a tulajdonságleíró myCustOrders, ahogyan a GetItemProperties metódus meghívása is egy listaelem-tömbdel, amely a tulajdonságleírókat myCustOrders tartalmazza, visszaadja a tulajdonságleírókat a következőhöz myOrders: .

A következőre érvényes:

Lásd még