共用方式為


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

'宣告
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

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

See Also

Reference

IModelBus Interface

CreateAdapter Overload

Microsoft.VisualStudio.Modeling.Integration Namespace