BindingManagerBase.GetItemProperties メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
データ ソースのプロパティ記述子の一覧を取得します。
オーバーロード
| 名前 | 説明 |
|---|---|
| GetItemProperties() |
派生クラスでオーバーライドされると、バインディングのプロパティ記述子のコレクションを取得します。 |
| GetItemProperties(ArrayList, ArrayList) |
指定した ArrayListを使用して、バインディングのプロパティ記述子のコレクションを取得します。 |
| GetItemProperties(Type, Int32, ArrayList, ArrayList) |
この BindingManagerBaseによって管理される項目のプロパティの一覧を取得します。 |
GetItemProperties()
派生クラスでオーバーライドされると、バインディングのプロパティ記述子のコレクションを取得します。
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
返品
バインディングのプロパティ記述子を表す PropertyDescriptorCollection 。
例
次のコード例では、 GetItemProperties メソッドを使用して PropertyDescriptorCollectionを返します。 この例では、PropertyDescriptorの GetValue メソッドを使用して、現在のDataColumnのNameと値を出力します。
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
こちらもご覧ください
適用対象
GetItemProperties(ArrayList, ArrayList)
指定した ArrayListを使用して、バインディングのプロパティ記述子のコレクションを取得します。
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);
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
パラメーター
返品
バインディングのプロパティ記述子を表す PropertyDescriptorCollection 。
注釈
このメソッドは、データ バインド コントロールを作成する開発者によって使用されます。
こちらもご覧ください
適用対象
GetItemProperties(Type, Int32, ArrayList, ArrayList)
この BindingManagerBaseによって管理される項目のプロパティの一覧を取得します。
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
パラメーター
- offset
- Int32
メソッドを再帰的に呼び出すために使用されるカウンター。
返品
バインディングのプロパティ記述子を表す PropertyDescriptorCollection 。
例
次のコード例では、GetItemProperties メソッドを使用して、BindingManagerBaseのPropertyDescriptorCollectionを返します。 次に、コレクション内の各PropertyDescriptorのNameとPropertyTypeを出力します。
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
注釈
このオーバーロードは、開発者がデータ バインド コントロールを作成するために使用されます。