DataSourceIDConverter.IsValidDataSource(IComponent) 方法

定义

获取一个值,该值指示指定组件是否是有效数据源。Gets a value that indicates whether the specified component is a valid data source.

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

一个实现 IComponent 接口的对象。An object that implements the IComponent interface.

返回

Boolean

如果 component 是有效数据源,则为 true;否则,为 falsetrue if component is a valid data source; otherwise, false.

注解

IsValidDataSource如果参数实现接口,则将其视为 component 有效的数据源 IDataSourceThe IsValidDataSource method considers the component parameter to be a valid data source if it implements the IDataSource interface.

继承者说明

IsValidDataSource(IComponent)方法应由需要进一步调查给定组件的控件重写,以确定是否应在标准值列表中返回该组件。The IsValidDataSource(IComponent) method should be overridden by controls that need to further investigate a given component to decide whether it should be returned in the list of standard values. 例如,如果控件仅适用于 XmlDataSource 数据源,则 IsValidDataSource(IComponent)true 仅为对象的那些组件返回 XmlDataSourceFor example, if a control works with only XmlDataSource data sources, IsValidDataSource(IComponent) should return true only for those components that are XmlDataSource objects.

适用于

另请参阅