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を実装するオブジェクトに対して取得するコンテナーの一覧を識別するプロパティ記述子が含まれます。 たとえば、myCustomersmyOrdersの 2 つのテーブルを含むDataSetと、myCustOrdersと呼ばれるリレーションシップがあります。 myCustomersを表示するDataView オブジェクトを作成した場合、null を使用して GetItemProperties メソッドを呼び出すと、myCustomers内の列のプロパティ記述子が返されます。 その結果、返されるプロパティ記述子の 1 つは、myCustOrdersのプロパティ記述子です。myCustOrdersのプロパティ記述子を含むリスト アクセサー配列を使用してGetItemProperties メソッドを呼び出すと、myOrdersのプロパティ記述子が返されます。

適用対象

こちらもご覧ください