DataConnectionSupport 类

提供使您能够直接与数据源的连接一起使用的属性和方法。

继承层次结构

System.Object
  Microsoft.VisualStudio.Data.Framework.ServiceProvider
    Microsoft.VisualStudio.Data.Framework.DataSiteableServiceProvider<IVsDataConnection>
      Microsoft.VisualStudio.Data.Framework.DataConnectionSupport
        Microsoft.VisualStudio.Data.Framework.AdoDotNet.AdoDotNetConnectionSupport

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

语法

声明
Public MustInherit Class DataConnectionSupport _
    Inherits DataSiteableServiceProvider(Of IVsDataConnection) _
    Implements IVsDataConnectionSupport, IServiceProvider, IDisposable, IVsDataConnectionEvents
public abstract class DataConnectionSupport : DataSiteableServiceProvider<IVsDataConnection>, 
    IVsDataConnectionSupport, IServiceProvider, IDisposable, IVsDataConnectionEvents
public ref class DataConnectionSupport abstract : public DataSiteableServiceProvider<IVsDataConnection^>, 
    IVsDataConnectionSupport, IServiceProvider, IDisposable, IVsDataConnectionEvents
[<AbstractClass>]
type DataConnectionSupport =  
    class
        inherit DataSiteableServiceProvider<IVsDataConnection>
        interface IVsDataConnectionSupport
        interface IServiceProvider
        interface IDisposable
        interface IVsDataConnectionEvents
    end
public abstract class DataConnectionSupport extends DataSiteableServiceProvider<IVsDataConnection> implements IVsDataConnectionSupport, IServiceProvider, IDisposable, IVsDataConnectionEvents

DataConnectionSupport 类型公开以下成员。

构造函数

  名称 说明
受保护的方法 DataConnectionSupport 初始化 DataConnectionSupport 类的新实例。

页首

属性

  名称 说明
公共属性 ConnectionString 获取或设置所需的信息的字符串表示形式生成指定的数据源将连接。
公共属性 ConnectionTimeout 获取或设置要等待的时间量,在建立连接时在终止在尝试和生成超时错误之前。
受保护的属性 ParentProvider 获取父服务提供程序的当前实例。 (继承自 ServiceProvider。)
公共属性 ProviderObject 获取基础数据提供程序,以支持当前数据连接。
受保护的属性 ServiceProvider 获取全局 Visual Studio 服务提供程序。
公共属性 Site 获取或设置该站点。 (继承自 DataSiteableServiceProvider<T>。)
公共属性 State 获取数据连接的状态。

页首

方法

  名称 说明
公共方法 AddService(Type, ServiceCreatorCallback) 向其中添加项时指定的服务到服务的内部集合。 (继承自 ServiceProvider。)
公共方法 AddService(Type, Object) 向其中添加项时指定的服务到服务的内部集合。 (继承自 ServiceProvider。)
公共方法 AddService(Type, ServiceCreatorCallback, Boolean) 向其中添加项时指定的服务到服务的内部集合或到父服务容器。 (继承自 ServiceProvider。)
公共方法 AddService(Type, Object, Boolean) 向其中添加项时指定的服务添加到服务对象的集合或到父服务容器。 (继承自 ServiceProvider。)
公共方法 Close 关闭指定的连接。
受保护的方法 CreateService 创建新的服务对象,指定接口服务类型。
公共方法 Dispose() 释放数据连接占用的所有资源。
受保护的方法 Dispose(Boolean) 释放数据连接占用的所有资源。
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 数据连接支持对象被销毁时,释放数据连接占用的所有资源。 (重写 Object.Finalize()。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetService(Guid) 检索使用已指定的服务GUID的服务。 (继承自 ServiceProvider。)
公共方法 GetService(Type) 检索具有指定类型的服务。 (继承自 ServiceProvider。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 Initialize 初始化指定的连接,并且可以从现有数据提供程序对象。
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
受保护的方法 OnMessageReceived 处理 MessageReceived 事件。
受保护的方法 OnSiteChanged 引发 SiteChanged 事件。 (继承自 DataSiteableServiceProvider<T>。)
受保护的方法 OnStateChanged 处理 StateChanged 事件。
公共方法 Open 打开指定的数据连接。
公共方法 RemoveService(Type) 从内部服务集合中移除项时指定的服务 (继承自 ServiceProvider。)
公共方法 RemoveService(Type, Boolean) 移除项时指定的服务从内部服务集合或从父服务容器。 (继承自 ServiceProvider。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

事件

  名称 说明
公共事件 MessageReceived 当消息从数据源,接收发生。
公共事件 SiteChanged 当站点已更改,发生。 (继承自 DataSiteableServiceProvider<T>。)
公共事件 StateChanged 数据连接的状态更改时,发生。

页首

显式接口实现

  名称 说明
显式接口实现私有方法 IServiceProvider.QueryService 执行为通过 IServiceProvider的实现中显示的服务的一个工厂。 (继承自 ServiceProvider。)

页首

备注

DataConnectionSupport 选件类表示数据提供程序实现支持数据连接。

此选件类的属性和方法提供允许数据提供程序与数据源通信的基本功能,是作为开始和密切关系和检索连接状态这样的任务。数据提供程序可以通过重写 CreateService 方法还显示专用服务。当前连接相关的服务可总结了:

此选件类实现 IVsDataSiteableObject<T> 接口,允许DDEX放置数据提供程序的 IVsDataConnection 对象的 DataConnectionSupport 实现调用它。这使实现提供上下文,和方法提供用于检索 Visual Studio 服务。

对继承者的说明

任何派生类应执行各种抽象属性和方法支持它们的连接。派生类还应重写受保护的 CreateService 方法提供其连接服务的实现。当状态更改或接收消息的事件发生时,派生类,应,如果可能,调用受保护的 OnStateChangedOnMessageReceived 方法。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.Data.Framework 命名空间