IDataSource.GetViewNames メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
IDataSource インターフェイスに関連付けられているビュー オブジェクトの一覧を表す名前のコレクションを取得します。
public:
System::Collections::ICollection ^ GetViewNames();
public System.Collections.ICollection GetViewNames();
abstract member GetViewNames : unit -> System.Collections.ICollection
Public Function GetViewNames () As ICollection
返品
ICollectionに関連付けられたビューの名前を含むIDataSource。
例
次のコード例は、 IDataSource インターフェイスを実装するデータ ソース コントロールが GetViewNames メソッドを実装し、名前の ICollection コレクションを返す方法を示しています。 データ ソースは 1 つのビューのみをサポートするため、このメソッドはビューの既定の名前を使用して 1 つの要素のコレクションを返します。 このコード例は、 DataSourceControl クラスに提供されるより大きな例の一部です。
// The ListSourceHelper class calls GetList, which
// calls the DataSourceControl.GetViewNames method.
// Override the original implementation to return
// a collection of one element, the default view name.
protected override ICollection GetViewNames() {
ArrayList al = new ArrayList(1);
al.Add(CsvDataSourceView.DefaultViewName);
return al as ICollection;
}
}
' The ListSourceHelper class calls GetList, which
' calls the DataSourceControl.GetViewNames method.
' Override the original implementation to return
' a collection of one element, the default view name.
Protected Overrides Function GetViewNames() As ICollection
Dim al As New ArrayList(1)
al.Add(CsvDataSourceView.DefaultViewName)
Return CType(al, ICollection)
End Function 'GetViewNames
End Class
注釈
データ ソース管理クラスは、基になるデータに対して 1 つ以上の名前付きビューをサポートできます。 GetViewNames メソッドは、現在データ ソース管理インスタンスに関連付けられているビュー名のコレクションを返します。 呼び出し元は、ビュー名のコレクションを反復処理し、DataSourceView メソッドを使用して個々のGetView オブジェクトを取得できます。
IDataSource インターフェイスを実装するデータ ソース管理クラスは、GetViewNames メソッドを実装し、現在データ ソース管理クラスに関連付けられているすべてのデータ ソース ビュー オブジェクトを表す名前のコレクションを返します。