ITypedList.GetItemProperties(PropertyDescriptor[]) Yöntem

Tanım

PropertyDescriptorCollection Verileri bağlamak için kullanılan her öğedeki özellikleri temsil eden öğesini döndürür.

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

Parametreler

listAccessors
PropertyDescriptor[]

Koleksiyonda bağlanabilir olarak bulunabilen bir nesne dizisi PropertyDescriptor . Bu olabilir null.

Döndürülenler

PropertyDescriptorCollection Verileri bağlamak için kullanılan her öğedeki özellikleri temsil eden.

Örnekler

Aşağıdaki kod örneği, yönteminin nasıl uygulanduğunu GetItemProperties gösterir. Tam kod listesi için bkz . Nasıl yapılır: ITypedList Arabirimini Uygulama.

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

Açıklamalar

listAccessors parametresi değilsenull, genellikle uygulayan nesne için alınacak kapsayıcıların listesini tanımlayan bir özellik tanımlayıcısı ITypedListiçerir. Örneğin, DataSet iki tablo içeren ve myOrdersarasında adlı myCustOrdersbir ilişki bulunan bir tablomyCustomers. görüntülemek için bir DataView nesne oluşturursanız, ile yöntemini null çağırmak GetItemProperties içindeki myCustomerssütunlar için özellik tanımlayıcılarını myCustomersdöndürür. Sonuç olarak, döndürülen özellik tanımlayıcılarından biri için myCustOrdersbir özellik tanımlayıcısıdır, tıpkı yöntemini için myCustOrders özellik tanımlayıcılarını içeren bir liste erişimci dizisiyle çağırmanın GetItemProperties için özellik tanımlayıcılarını döndürmesi gibimyOrders.

Şunlara uygulanır

Ayrıca bkz.