CurrencyManager.GetItemProperties Метод

Определение

Возвращает коллекцию дескрипторов свойств для базового списка.

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

Возвращаемое значение

Коллекция PropertyDescriptorCollection для списка.

Примеры

В следующем примере кода метод используется GetItemProperties для возврата PropertyDescriptorCollection для BindingManagerBase. Затем в примере выводится Name и PropertyType каждого из них PropertyDescriptor в коллекции.

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

Комментарии

для PropertyDescriptorCollection используется для CurrencyManager указания столбца в списке.

Применяется к

См. также раздел