DesignTimeData.GetSelectedDataSource 方法

定义

获取在设计宿主中根据名称选择并由指定组件的站点属性表示的数据源。

重载

GetSelectedDataSource(IComponent, String)

获取在设计宿主中根据名称选择、由指定组件的站点属性表示并由指定的数据源名称标识的数据源。

GetSelectedDataSource(IComponent, String, String)

获取在设计宿主中根据名称选择、由指定组件的站点属性表示并由指定的数据源名称和成员名称标识的数据源。

GetSelectedDataSource(IComponent, String)

获取在设计宿主中根据名称选择、由指定组件的站点属性表示并由指定的数据源名称标识的数据源。

public:
 static System::Object ^ GetSelectedDataSource(System::ComponentModel::IComponent ^ component, System::String ^ dataSource);
public static object GetSelectedDataSource (System.ComponentModel.IComponent component, string dataSource);
static member GetSelectedDataSource : System.ComponentModel.IComponent * string -> obj
Public Shared Function GetSelectedDataSource (component As IComponent, dataSource As String) As Object

参数

component
IComponent

包含数据源的 IComponent 对象。

dataSource
String

要检索的数据源的名称。

返回

Object

一个实现表示所选数据源的 IListSourceIEnumerable 的对象,如果未能访问数据源或设计器宿主,则为 null

另请参阅

适用于

GetSelectedDataSource(IComponent, String, String)

获取在设计宿主中根据名称选择、由指定组件的站点属性表示并由指定的数据源名称和成员名称标识的数据源。

public:
 static System::Collections::IEnumerable ^ GetSelectedDataSource(System::ComponentModel::IComponent ^ component, System::String ^ dataSource, System::String ^ dataMember);
public static System.Collections.IEnumerable GetSelectedDataSource (System.ComponentModel.IComponent component, string dataSource, string dataMember);
static member GetSelectedDataSource : System.ComponentModel.IComponent * string * string -> System.Collections.IEnumerable
Public Shared Function GetSelectedDataSource (component As IComponent, dataSource As String, dataMember As String) As IEnumerable

参数

component
IComponent

一个对象,实现包含数据源属性的 IComponent

dataSource
String

要检索的数据源。

dataMember
String

要检索的数据成员。

返回

IEnumerable

一个对象,实现包含数据成员的 IEnumerable 的对象;如果未能访问数据源、成员或组件站点,则为 null

另请参阅

适用于