CurrencyManager.GetItemProperties Metoda

Definicja

Pobiera kolekcję deskryptora właściwości dla bazowej listy.

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

Zwraca

A PropertyDescriptorCollection dla listy.

Przykłady

Poniższy przykład kodu używa metody , GetItemProperties aby zwrócić element PropertyDescriptorCollection dla klasy BindingManagerBase. W tym przykładzie są wyświetlane wartości Name i PropertyType z każdej PropertyDescriptor z nich w kolekcji.

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

Uwagi

Element PropertyDescriptorCollection dla elementu CurrencyManager służy do określania kolumny na liście.

Dotyczy

Zobacz też