ITypedList.GetItemProperties(PropertyDescriptor[]) メソッド

定義

データ バインドに使用される各項目のプロパティを表す PropertyDescriptorCollection を返します。

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

パラメーター

listAccessors
PropertyDescriptor[]

コレクションから検索するバインド可能な PropertyDescriptor オブジェクトの配列。 これは null でもかまいません。

戻り値

データ バインドに使用される各項目のプロパティを表す PropertyDescriptorCollection

次のコード例は、 メソッドを実装する方法を GetItemProperties 示しています。 完全なコード一覧については、「 方法: ITypedList インターフェイスを実装する」を参照してください。

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

注釈

パラメーターが listAccessors でない null場合は、通常、 を実装するオブジェクトに対して取得するコンテナーの一覧を識別するプロパティ記述子が含まれます ITypedList。 たとえば、 DataSet と の 2 つのテーブルを含み、 myCustomersmyOrdersそれらの間のリレーションシップが と呼ばれます myCustOrders。 を表示myCustomersするオブジェクトをDataView作成した場合、 を使用nullして メソッドをGetItemProperties呼び出すと、 の列myCustomersのプロパティ記述子が返されます。 その結果、返されるプロパティ記述子の 1 つは のmyCustOrdersプロパティ記述子です。同様に、 のプロパティmyCustOrders記述子を含むリスト アクセサー配列を使用して メソッドを呼び出GetItemPropertiesすと、 のプロパティ記述子myOrdersが返されます。

適用対象

こちらもご覧ください