DataSourceConverter.IsValidDataSource(IComponent) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示指定的元件是否為該轉換器的有效資料來源。
protected:
virtual bool IsValidDataSource(System::ComponentModel::IComponent ^ component);
protected virtual bool IsValidDataSource(System.ComponentModel.IComponent component);
abstract member IsValidDataSource : System.ComponentModel.IComponent -> bool
override this.IsValidDataSource : System.ComponentModel.IComponent -> bool
Protected Overridable Function IsValidDataSource (component As IComponent) As Boolean
參數
- component
- IComponent
要檢查的元件是否為有效資料來源。
傳回
true 若實現 componentIEnumerable 或 IListSource;否則, false。
備註
該 GetStandardValues 方法利用此 IsValidDataSource 方法來判斷作為標準可存取資料來源的組成部分。 對於類別 DataSourceConverter 而言,有效的資料來源是實作 IEnumerable OR IListSource 介面的元件。
給繼承者的注意事項
自訂資料來源轉換器可以從類別 DataSourceConverter 衍生並覆寫該 IsValidDataSource(IComponent) 方法,以測試使用元件作為資料來源所需的介面實作。