DataSourceControl.IListSource.GetList 方法

定义

获取可用作数据列表的源的数据源控件列表。Gets a list of data source controls that can be used as sources of lists of data.

 virtual System::Collections::IList ^ System.ComponentModel.IListSource.GetList() = System::ComponentModel::IListSource::GetList;
System.Collections.IList IListSource.GetList ();
Function GetList () As IList Implements IListSource.GetList

返回

一个 IList,其中所包含的数据源控件可用作数据列表的源。An IList of data source controls that can be used as sources of lists of data.

实现

注解

此方法用于检索可用作数据源的一组对象。This method is used to retrieve a set of objects that can be used as sources of data. DataSourceView数据源控件将DataSourceView DataSourceControl其数据列表封装为对象; 因此, 当与一个或多个对象关联时, 控件表示一个IList列表源对象, 方法返回的集合一个元素DataSourceControl本身。Data source controls encapsulate their lists of data as DataSourceView objects; therefore, when associated with one or more DataSourceView objects, a DataSourceControl control represents a list source object and the method returns an IList collection of one element, the DataSourceControl itself.

此方法调用静态ListSourceHelper.GetList方法来IList检索可用作数据源的对象的集合。This method calls the static ListSourceHelper.GetList method to retrieve an IList collection of objects that can be used as sources of data. 类确定是否GetViewNames返回有效的视图名称集合。 ListSourceHelperThe ListSourceHelper class determines whether GetViewNames returns a valid collection of view names. 如果是这样, 则ListSourceHelper该类IList返回一个元素 (即DataSourceControl控件) 的集合。If it does, the ListSourceHelper class returns an IList collection of one element, the DataSourceControl control. 如果GetViewNames DataSourceControl返回null(这是类的默认实现), 则ListSourceHelper类还会返回nullIf GetViewNames returns null, which is the default implementation of the DataSourceControl class, the ListSourceHelper class also returns null.

适用于

另请参阅