VsModelingAdapterManager::DoCreateAdapter Method (ModelBusReference^, IServiceProvider^)

 

Using the ModelBusReference passed as a parameter, creation of a ModelBusAdapter instance is attempted. If successful, the adapter is returned. If not, appropriate exception is thrown.

Namespace:   Microsoft.VisualStudio.Modeling.Integration.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Integration.Shell.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Integration.Shell.12.0.dll)

protected:
virtual ModelBusAdapter^ DoCreateAdapter(
	ModelBusReference^ reference,
	IServiceProvider^ serviceProvider
) override

Parameters

reference
Type: Microsoft.VisualStudio.Modeling.Integration::ModelBusReference^

Reference that will be used to created the ModelBusAdapter

serviceProvider
Type: System::IServiceProvider^

Used to create association between the caller and the referenced model. The serviceProvider can be null, but if it is not null then it must provide the SRelatedDocList service otherwise an exception will be thrown

Return Value

Type: Microsoft.VisualStudio.Modeling.Integration::ModelBusAdapter^

The created non-null ModelBusAdapter instance if successful, exception will be thrown otherwise.

If an IServiceProvider is supplied it must be able to lookup the Microsoft.VisualStudio.Modeling.Shell.SRelatedDocList service otherwise an exception will be thrown. This serviceProvider, if supplied, will be used to facilitate association between the created ModelBusAdapter and the caller. This is a private protocol implemented by this AdapterManager with its callers. The SRelatedDocList service will be used to link the saving of the caller's document with the saving of Model wrapped by the Adapter created through this API. For instance, this will trigger a save on the referenced model, when the caller's Document is itself saved in Visual Studio.

Return to top
Show: