VsModelingAdapterManager.DoCreateAdapter 方法

使用作为参数传递的 ModelBusReference, ModelBusAdapter 实例的创建将尝试。如果成功,适配器返回。否则,相应的异常时引发。

命名空间:  Microsoft.VisualStudio.Modeling.Integration.Shell
程序集:  Microsoft.VisualStudio.Modeling.Sdk.Integration.Shell.11.0(在 Microsoft.VisualStudio.Modeling.Sdk.Integration.Shell.11.0.dll 中)

语法

声明
Protected Overrides Function DoCreateAdapter ( _
    reference As ModelBusReference, _
    serviceProvider As IServiceProvider _
) As ModelBusAdapter
protected override ModelBusAdapter DoCreateAdapter(
    ModelBusReference reference,
    IServiceProvider serviceProvider
)

参数

  • serviceProvider
    类型:System.IServiceProvider
    用于创建在调用方和被引用的模型之间的关联。服务提供程序可以为空,则为; 但是,如果它不为空则必须提供 SRelatedDocList 服务异常会引发

返回值

类型:Microsoft.VisualStudio.Modeling.Integration.ModelBusAdapter
创建的非 null ModelBusAdapter 实例,如果成功,则会引发。

备注

如果提供 IServiceProvider 它必须能够找到 Microsoft.VisualStudio.Modeling.Shell.SRelatedDocList 服务异常会引发。此服务提供程序 (ssp),因此,如果提供,将使用促进创建的 ModelBusAdapter 和调用方之间的关联。这与其调用方的此 AdapterManager 实现的专用协议。SRelatedDocList 服务将使用链接调用方中保存的文档与适配器包装的设计保存创建通过此 API。例如,那么,当调用方的文档本身在 Visual Studio 中,保存这将触发该引用模型的保存。

.NET Framework 安全性

请参见

参考

VsModelingAdapterManager 类

Microsoft.VisualStudio.Modeling.Integration.Shell 命名空间