IVsDataProvider 接口

提供一 DDEX 提供程序。

命名空间:  Microsoft.VisualStudio.Data.Core
程序集:  Microsoft.VisualStudio.Data.Core(在 Microsoft.VisualStudio.Data.Core.dll 中)

语法

声明
Public Interface IVsDataProvider
public interface IVsDataProvider
public interface class IVsDataProvider
type IVsDataProvider =  interface end
public interface IVsDataProvider

IVsDataProvider 类型公开以下成员。

属性

  名称 说明
公共属性 Description 获取 DDEX 提供程序的说明。
公共属性 DisplayName 获取 DDEX 提供程序的显示名称。
公共属性 Guid 获取 DDEX 提供程序的唯一标识符。
公共属性 Name 获取 DDEX 提供程序的编程名称。
公共属性 ShortDisplayName 获取 DDEX 提供程序的简短的显示名称。
公共属性 Technology 获取 DDEX 提供程序使用和面向的基础技术的唯一标识符。

页首

方法

  名称 说明
公共方法 CreateObject(Type) 创建由 DDEX 提供程序实现指定的 DDEX 支持实体的实例。
公共方法 CreateObject(Guid, Type) 创建指定的 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。
公共方法 CreateObject<TObject>() 创建由 DDEX 提供程序实现指定的 DDEX 支持实体的实例。
公共方法 CreateObject<TObject>(Guid) 创建指定的 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。
公共方法 CreateObject<TSite>(Guid, Type, TSite) 创建指定的 DDEX 支持实体的实例由 DDEX 提供程序实现指定的 DDEX 数据源,使用指定站点的网站对象。
公共方法 CreateObject<TObject, TSite>(Guid, TSite) 创建指定的 DDEX 支持实体的实例由 DDEX 提供程序实现指定的 DDEX 数据源,使用指定站点的网站对象。
公共方法 DeriveSource 由派生 DDEX 提供程序支持的数据源 DDEX,提供有关目标数据源的信息。
公共方法 GetAssembly(String) 解决一提供程序特定程序集字符串为其对应的 Assembly 表示。
公共方法 GetAssembly(Guid, String) 解决一提供程序特定程序集字符串为其对应的 Assembly 表示。,特定 DDEX 数据源。
公共方法 GetMainAssembly 获取提供程序的主程序集。
公共方法 GetProperty 获取 DDEX 提供程序的注册的属性。
公共方法 GetString 从 DDEX 提供程序获取已本地化的字符串。
公共方法 GetType(String) 解决一特定于提供程序类型名称为其对应的 Type 表示。
公共方法 GetType(Guid, String) 解决一特定于提供程序类型名称为其对应的 Type 表示。,特定 DDEX 数据源。
公共方法 GetUnsupportedReason(CommandID, Object) 获取特定的已本地化的字符串操作的原因不支持。
公共方法 GetUnsupportedReason(Guid, CommandID, Object) 获取特定的已本地化的字符串操作的原因没有为指定的 DDEX 数据源支持。
公共方法 IsOperationSupported(CommandID, Object) 确定给定是否在当前操作由环境的提供程序支持。
公共方法 IsOperationSupported(Guid, CommandID, Object) 为指定的 DDEX 数据源确定特定操作是否支持在的当前环境,提供程序。
公共方法 SupportsObject(Type) 确定 DDEX 提供程序是否支持 DDEX 支持实体指定类型的。
公共方法 SupportsObject(Guid, Type) 确定 DDEX 提供程序是否支持 DDEX 指定的 DDEX 数据源中实体支持指定的类型。
公共方法 TryCreateObject(Type) 尝试创建的 DDEX 提供程序实现指定的 DDEX 支持实体的实例。
公共方法 TryCreateObject(Guid, Type) 尝试为指定的创建 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。
公共方法 TryCreateObject<TObject>() 尝试创建的 DDEX 提供程序实现指定的 DDEX 支持实体的实例。
公共方法 TryCreateObject<TObject>(Guid) 尝试为指定的创建 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。
公共方法 TryCreateObject<TSite>(Guid, Type, TSite) 尝试为指定的创建 DDEX 支持实体的实例由 DDEX 提供程序实现指定的 DDEX 数据源,使用指定站点的网站对象。
公共方法 TryCreateObject<TObject, TSite>(Guid, TSite) 尝试为指定的创建 DDEX 支持实体的实例由 DDEX 提供程序实现指定的 DDEX 数据源,使用指定站点的网站对象。

页首

备注

DDEX 提供程序对象提供有关在 Visual Studio 环境注册的提供程序的信息。 它是客户 DDEX 的入口点可以与交互 DDEX 提供程序。 与其他所有行区它以及各种各样的名称和说明之外,的每个提供程序都有一个唯一 GUID。 此接口提供定义提供程序的自定义特性的一组属性,以及检索本地化的字符串,如果为 ID 资源字符串是特定于提供程序的方法之外。 它还提供确定的 DDEX 数据源的方法,同时使包含有关目标数据源的信息的连接字符串。 它提供、识别创建的 DDEX 提供程序实现的实体支持方法。 最后,它是提供程序自己的供应托管类型的解决方法和程序集。

可以使用 IVsDataProviderManager 服务,DDEX 提供程序对象来检索。

示例

下面的代码演示客户如何检索特定 DDEX 提供程序和输出其显示名称和说明,然后创建一个 DDEX 标准支持实体。

using System;
using System.Diagnostics;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;

public class DDEX_IVsDataProviderExample1
{
    public static void UseDataProvider(
        IServiceProvider serviceProvider,
        Guid providerGuid)
    {
        IVsDataProviderManager providerManager =
            serviceProvider.GetService(typeof(IVsDataProviderManager))
                as IVsDataProviderManager;
        IVsDataProvider provider = providerManager.Providers[providerGuid];
        Trace.WriteLine(provider.DisplayName);
        Trace.WriteLine(provider.Description);
        IVsDataConnectionProperties connectionProperties =
            provider.CreateObject<IVsDataConnectionProperties>();
        connectionProperties.Parse("Test connection string");
    }
}

请参阅

参考

Microsoft.VisualStudio.Data.Core 命名空间