CurrencyManager.GetItemProperties Metoda

Definice

Získá popisovač vlastností kolekce podkladového seznamu.

public:
 override System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties();
public override System.ComponentModel.PropertyDescriptorCollection GetItemProperties ();
override this.GetItemProperties : unit -> System.ComponentModel.PropertyDescriptorCollection
Public Overrides Function GetItemProperties () As PropertyDescriptorCollection

Návraty

A PropertyDescriptorCollection pro seznam.

Příklady

Následující příklad kódu používá metodu GetItemProperties k vrácení PropertyDescriptorCollection pro BindingManagerBase. Příklad pak vytiskne hodnoty Name a PropertyType každého z nich PropertyDescriptor v kolekci.

void PrintPropertyDescriptions( BindingManagerBase^ b )
{
   Console::WriteLine( "Printing Property Descriptions" );
   PropertyDescriptorCollection^ ps = b->GetItemProperties();
   for ( int i = 0; i < ps->Count; i++ )
   {
      Console::WriteLine( "\t{0}\t{1}", ps[ i ]->Name, ps[ i ]->PropertyType );

   }
}
private void PrintPropertyDescriptions(BindingManagerBase b)
{
    Console.WriteLine("Printing Property Descriptions");
    PropertyDescriptorCollection ps = b.GetItemProperties();
    for(int i = 0; i < ps.Count; i++)
    {
        Console.WriteLine("\t" + ps[i].Name + "\t" + ps[i].PropertyType);
    }
}
Private Sub PrintPropertyDescriptions(b As BindingManagerBase)
    Console.WriteLine("Printing Property Descriptions")
    Dim ps As PropertyDescriptorCollection = b.GetItemProperties()
    Dim i As Integer
    For i = 0 To ps.Count - 1
        Console.WriteLine((ControlChars.Tab & ps(i).Name & ControlChars.Tab & ps(i).PropertyType.ToString))
    Next i
End Sub

Poznámky

Parametr PropertyDescriptorCollection pro CurrencyManager slouží k určení sloupce v seznamu.

Platí pro

Viz také