DataSourceControl.GetViewNames メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataSourceControl.GetViewNames メソッドの意味・解説 

DataSourceControl.GetViewNames メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

DataSourceControl コントロール関連付けられた DataSourceView オブジェクトリストを表す名前のコレクション取得します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Protected Overridable Function
 GetViewNames As ICollection
Dim returnValue As ICollection

returnValue = Me.GetViewNames
protected virtual ICollection GetViewNames ()
protected:
virtual ICollection^ GetViewNames ()
protected ICollection GetViewNames ()
protected function GetViewNames () : ICollection

戻り値
DataSourceControl関連付けられた DataSourceView オブジェクトの名前が格納されている ICollection。

解説解説

名前の ICollection コレクションは、GetView メソッド渡せ許容値を表すセットです。

DataSourceControl クラスの IListSource の実装使用される ListSourceHelper クラスは、System.ComponentModel.IListSource.ContainsListCollection 呼び出しおよび System.ComponentModel.IListSource.GetList 呼び出し両方GetViewNames メソッド確認しデータ ソース コントロール1 つ上のデータ ソース ビュー関連付けられているかどうか判断しますGetViewNamesnull 参照 (Visual Basic では Nothing) を返す場合メソッド既定実装示します。この場合System.ComponentModel.IListSource.ContainsListCollectionfalse返しSystem.ComponentModel.IListSource.GetListnull 参照 (Visual Basic では Nothing) を返します

メモメモ

DataSourceControl クラス既定実装では、null 参照 (Visual Basic では Nothing) を返しますDataSourceControl クラス拡張する場合は、GetViewNames メソッドオーバーライドし、ビュー名のコレクション返します

使用例使用例

DataSourceControl クラス拡張するクラスで、null 参照 (Visual Basic では Nothing) を返す既定実装オーバーライドしてビュー名のコレクション提供する方法次のコード例示しますCsvDataSource クラス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 Overrides Function
 GetViewNames() As ICollection
      Dim al As New ArrayList(1)
      al.Add(CsvDataSourceView.DefaultViewName)
      Return CType(al, ICollection)
   End Function 'GetViewNames

End Class 'CsvDataSource
    // 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;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataSourceControl.GetViewNames メソッド」の関連用語

DataSourceControl.GetViewNames メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataSourceControl.GetViewNames メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS