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 命名空间