IModelBus.CreateAdapter Method (ModelBusReference, IServiceProvider)
Attempts to create and return a new adapter instance for the supplied reference. Allows a service provider to be supplied.
Namespace: Microsoft.VisualStudio.Modeling.Integration
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Integration.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Integration.10.0.dll)
Syntax
'Declaration
Function CreateAdapter ( _
reference As ModelBusReference, _
serviceProvider As IServiceProvider _
) As ModelBusAdapter
ModelBusAdapter CreateAdapter(
ModelBusReference reference,
IServiceProvider serviceProvider
)
ModelBusAdapter^ CreateAdapter(
ModelBusReference^ reference,
IServiceProvider^ serviceProvider
)
abstract CreateAdapter :
reference:ModelBusReference *
serviceProvider:IServiceProvider -> ModelBusAdapter
function CreateAdapter(
reference : ModelBusReference,
serviceProvider : IServiceProvider
) : ModelBusAdapter
Parameters
- reference
Type: Microsoft.VisualStudio.Modeling.Integration.ModelBusReference
The reference to a model or an element within it.
- serviceProvider
Type: System.IServiceProvider
A service provider to pass on to the new adapter. Can be null.
Return Value
Type: Microsoft.VisualStudio.Modeling.Integration.ModelBusAdapter
The adapter that was created, or null if one could not be created
Remarks
The IServiceProvider should be used by callers to supply services that implement a private protocol between the caller and the Adapter being created by the AdapterManager. If an AdapterManager does not require any special services from the caller or if the client does not wish to invoke the private protocol, then this API should not be used. Instead, use the overloaded CreateAdapter() which just accepts a ModelBusReference. Note to implementors: In order to retrieve general purpose Services, use the ModelBus's ServiceProvider or any other standard ServiceProvider instead.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.