Share via


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 bulunacak 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 GetItemProperties nasıl uygulanduğunu 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 myCustomers içeren ve myOrdersarasında adlı myCustOrdersbir ilişki bulunan bir . görüntülemek için bir DataView nesne oluşturursanız, yöntemini ile 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 ö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 gibi myCustOrdersmyOrders.

Şunlara uygulanır

Ayrıca bkz.