Muokkaa

Jaa


DataSourceProviderService.AddDataSourceInstance Method

Definition

When overridden in a derived class, creates and returns an instance of the given data source, and adds it to the design surface.

public:
 abstract System::Object ^ AddDataSourceInstance(System::ComponentModel::Design::IDesignerHost ^ host, System::ComponentModel::Design::Data::DataSourceDescriptor ^ dataSourceDescriptor);
public abstract object AddDataSourceInstance (System.ComponentModel.Design.IDesignerHost host, System.ComponentModel.Design.Data.DataSourceDescriptor dataSourceDescriptor);
abstract member AddDataSourceInstance : System.ComponentModel.Design.IDesignerHost * System.ComponentModel.Design.Data.DataSourceDescriptor -> obj
Public MustOverride Function AddDataSourceInstance (host As IDesignerHost, dataSourceDescriptor As DataSourceDescriptor) As Object

Parameters

host
IDesignerHost

The designer host.

dataSourceDescriptor
DataSourceDescriptor

The data source.

Returns

An Object representing an instance of the added data source.

Exceptions

The type name cannot be created or resolved.

Remarks

You should only call the AddDataSourceInstance method on data sources that are designable for example, if the IsDesignable value is true.

This method enables the service implementer to perform custom actions when a data source is added to the design surface.

Applies to