BindingManagerBase.GetItemProperties Yöntem

Tanım

Veri kaynağı için özellik tanımlayıcılarının listesini alır.

Aşırı Yüklemeler

GetItemProperties()

Türetilmiş bir sınıfta geçersiz kılındığında, bağlama için özellik tanımlayıcıları koleksiyonunu alır.

GetItemProperties(ArrayList, ArrayList)

Belirtilen ArrayListkullanarak bağlama için özellik tanımlayıcıları koleksiyonunu alır.

GetItemProperties(Type, Int32, ArrayList, ArrayList)

Bu BindingManagerBasetarafından yönetilen öğelerin özelliklerinin listesini alır.

GetItemProperties()

Türetilmiş bir sınıfta geçersiz kılındığında, bağlama için özellik tanımlayıcıları koleksiyonunu alır.

public:
 abstract System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties();
public:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties();
public abstract System.ComponentModel.PropertyDescriptorCollection GetItemProperties ();
public virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties ();
abstract member GetItemProperties : unit -> System.ComponentModel.PropertyDescriptorCollection
abstract member GetItemProperties : unit -> System.ComponentModel.PropertyDescriptorCollection
override this.GetItemProperties : unit -> System.ComponentModel.PropertyDescriptorCollection
Public MustOverride Function GetItemProperties () As PropertyDescriptorCollection
Public Overridable Function GetItemProperties () As PropertyDescriptorCollection

Döndürülenler

PropertyDescriptorCollection

PropertyDescriptorCollection Bağlama için özellik tanımlayıcılarını temsil eden bir.

Örnekler

Aşağıdaki kod örneği, bir PropertyDescriptorCollectiondöndürmek için yöntemini kullanırGetItemProperties. Örnek, yöntemini kullanarak geçerlinin DataColumn ve değerini yazdırır.Name PropertyDescriptorGetValue

void ShowGetItemProperties()
{
   
   // Create a new DataTable and add two columns.
   DataTable^ dt = gcnew DataTable;
   dt->Columns->Add( "Name", Type::GetType( "System.String" ) );
   dt->Columns->Add( "ID", Type::GetType( "System.String" ) );
   
   // Add a row to the table.
   DataRow^ dr = dt->NewRow();
   dr[ "Name" ] = "Ann";
   dr[ "ID" ] = "AAA";
   dt->Rows->Add( dr );
   PropertyDescriptorCollection^ myPropertyDescriptors = this->BindingContext[ dt ]->GetItemProperties();
   PropertyDescriptor^ myPropertyDescriptor = myPropertyDescriptors[ "Name" ];
   Console::WriteLine( myPropertyDescriptor->Name );
   Console::WriteLine( myPropertyDescriptor->GetValue( dt->DefaultView[ 0 ] ) );
}
private void ShowGetItemProperties()
{
   // Create a new DataTable and add two columns.
   DataTable dt = new DataTable();
   dt.Columns.Add("Name", Type.GetType("System.String"));
   dt.Columns.Add("ID", Type.GetType("System.String"));
   // Add a row to the table.
   DataRow dr = dt.NewRow();
   dr["Name"] = "Ann";
   dr["ID"] = "AAA";
   dt.Rows.Add(dr);

   PropertyDescriptorCollection myPropertyDescriptors = 
   this.BindingContext[dt].GetItemProperties();
   PropertyDescriptor myPropertyDescriptor = 
   myPropertyDescriptors["Name"];
   Console.WriteLine(myPropertyDescriptor.Name);
   Console.WriteLine(myPropertyDescriptor.GetValue
   (dt.DefaultView[0]));
}
Private Sub ShowGetItemProperties()
   ' Create a new DataTable and add two columns.
   Dim dt As New DataTable()
   dt.Columns.Add("Name", Type.GetType("System.String"))
   dt.Columns.Add("ID", Type.GetType("System.String"))
   ' Add a row to the table.
   Dim dr As DataRow = dt.NewRow()
   dr("Name") = "Ann"
   dr("ID") = "AAA"
   dt.Rows.Add(dr)
     
   Dim myPropertyDescriptors As PropertyDescriptorCollection = _
   Me.BindingContext(dt).GetItemProperties()
   Dim myPropertyDescriptor As PropertyDescriptor = myPropertyDescriptors("Name")
   Console.WriteLine(myPropertyDescriptor.Name)
   Console.WriteLine(myPropertyDescriptor.GetValue(dt.DefaultView(0)))
End Sub

Ayrıca bkz.

Şunlara uygulanır

GetItemProperties(ArrayList, ArrayList)

Belirtilen ArrayListkullanarak bağlama için özellik tanımlayıcıları koleksiyonunu alır.

protected public:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties(System::Collections::ArrayList ^ dataSources, System::Collections::ArrayList ^ listAccessors);
protected internal virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties (System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
protected internal virtual System.ComponentModel.PropertyDescriptorCollection? GetItemProperties (System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
abstract member GetItemProperties : System.Collections.ArrayList * System.Collections.ArrayList -> System.ComponentModel.PropertyDescriptorCollection
override this.GetItemProperties : System.Collections.ArrayList * System.Collections.ArrayList -> System.ComponentModel.PropertyDescriptorCollection
Protected Friend Overridable Function GetItemProperties (dataSources As ArrayList, listAccessors As ArrayList) As PropertyDescriptorCollection

Parametreler

dataSources
ArrayList

ArrayList Veri kaynaklarını içeren.

listAccessors
ArrayList

ArrayList Tablonun ilişkili özelliklerini içeren.

Döndürülenler

PropertyDescriptorCollection

PropertyDescriptorCollection Bağlama için özellik tanımlayıcılarını temsil eden bir.

Açıklamalar

Bu yöntem, veriye bağlı denetimler oluşturan geliştiriciler tarafından kullanılır.

Ayrıca bkz.

Şunlara uygulanır

GetItemProperties(Type, Int32, ArrayList, ArrayList)

Bu BindingManagerBasetarafından yönetilen öğelerin özelliklerinin listesini alır.

protected:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ GetItemProperties(Type ^ listType, int offset, System::Collections::ArrayList ^ dataSources, System::Collections::ArrayList ^ listAccessors);
protected virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties (Type listType, int offset, System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
protected virtual System.ComponentModel.PropertyDescriptorCollection? GetItemProperties (Type listType, int offset, System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
abstract member GetItemProperties : Type * int * System.Collections.ArrayList * System.Collections.ArrayList -> System.ComponentModel.PropertyDescriptorCollection
override this.GetItemProperties : Type * int * System.Collections.ArrayList * System.Collections.ArrayList -> System.ComponentModel.PropertyDescriptorCollection
Protected Overridable Function GetItemProperties (listType As Type, offset As Integer, dataSources As ArrayList, listAccessors As ArrayList) As PropertyDescriptorCollection

Parametreler

listType
Type

Type İlişkili listenin değeri.

offset
Int32

Yöntemini yinelemeli olarak çağırmak için kullanılan bir sayaç.

dataSources
ArrayList

ArrayList Veri kaynaklarını içeren.

listAccessors
ArrayList

ArrayList Tablonun ilişkili özelliklerini içeren.

Döndürülenler

PropertyDescriptorCollection

PropertyDescriptorCollection Bağlama için özellik tanımlayıcılarını temsil eden bir.

Örnekler

Aşağıdaki kod örneği için bir PropertyDescriptorCollection döndürmek için BindingManagerBaseyöntemini kullanırGetItemProperties. Örnek daha sonra koleksiyondaki Name her PropertyDescriptor birinin ve PropertyType değerlerini yazdırır.

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

Açıklamalar

Bu aşırı yükleme, geliştiriciler tarafından verilere bağlı denetimler oluşturmak için kullanılır.

Ayrıca bkz.

Şunlara uygulanır