Delen via


DataConnectionSupport Class

Provides properties and methods that enable you to work directly with connections to a data source.

Inheritance Hierarchy

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

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
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

The DataConnectionSupport type exposes the following members.

Constructors

  Name Description
Protected method DataConnectionSupport Initializes a new instance of the DataConnectionSupport class.

Top

Properties

  Name Description
Public property ConnectionString Gets or sets a string representation of information required to establish a specified data source connection.
Public property ConnectionTimeout Gets or sets the amount of time to wait when establishing a connection before terminating the attempt and generating a timeout error.
Protected property ParentProvider Gets the current instance of the parent service provider. (Inherited from ServiceProvider.)
Public property ProviderObject Gets the underlying data provider, which supports the current data connection.
Protected property ServiceProvider Gets the global Visual Studio service provider.
Public property Site Gets or sets the site. (Inherited from DataSiteableServiceProvider<T>.)
Public property State Gets the state of the data connection.

Top

Methods

  Name Description
Public method AddService(Type, ServiceCreatorCallback) Adds the specified service to the internal collection of services. (Inherited from ServiceProvider.)
Public method AddService(Type, Object) Adds the specified service to the internal collection of services. (Inherited from ServiceProvider.)
Public method AddService(Type, ServiceCreatorCallback, Boolean) Adds the specified service to the internal collection of services or to the parent service container. (Inherited from ServiceProvider.)
Public method AddService(Type, Object, Boolean) Adds the specified service to the collection of service objects or to the parent service container. (Inherited from ServiceProvider.)
Public method Close Closes the specified connection.
Protected method CreateService Creates a new service object, specifying the interface service type.
Public method Dispose() Releases all resources held by the data connection.
Protected method Dispose(Boolean) Releases all resources held by the data connection.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Releases all resources held by the data connection when the data connection support object is destroyed. (Overrides Object.Finalize().)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetService(Guid) Retrieves a service with a specified service GUID. (Inherited from ServiceProvider.)
Public method GetService(Type) Retrieves a service of the specified type. (Inherited from ServiceProvider.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Initialize Initializes the specified connection, optionally from an existing data provider object.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnMessageReceived Handles the MessageReceived event.
Protected method OnSiteChanged Raises the SiteChanged event. (Inherited from DataSiteableServiceProvider<T>.)
Protected method OnStateChanged Handles the StateChanged event.
Public method Open Opens the specified data connection.
Public method RemoveService(Type) Removes the specified service from the internal services collection (Inherited from ServiceProvider.)
Public method RemoveService(Type, Boolean) Removes the specified service from the internal services collection or from the parent service container. (Inherited from ServiceProvider.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event MessageReceived Occurs when a message is received from the data source.
Public event SiteChanged Occurs when the site has changed. (Inherited from DataSiteableServiceProvider<T>.)
Public event StateChanged Occurs when the state of the data connection has changed.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IServiceProvider.QueryService Performs as a factory for services that are exposed through an implementation of IServiceProvider. (Inherited from ServiceProvider.)

Top

Remarks

The DataConnectionSupport class represents the data provider implementation to support a data connection.

The properties and methods of this class provide basic functionality that allows the data provider to communicate with the data source, performing such tasks as opening and closing connections and retrieving connection state. A data provider can also expose specialized services by overriding the CreateService method. The current connection-related services can be summarized as follows:

  • IVsDataObjectSupport: Provides a method for retrieving XML that describes types of data objects supported by the data source and actions that can be performed on them.

  • IVsDataObjectIdentifierResolver: Provides a method for resolving data object identifiers.

  • IVsDataObjectIdentifierConverter: Provides methods for converting between string and array representations of data object identifiers.

  • IVsDataObjectMemberComparer: Provides methods for comparing data object identifier parts and property values.

  • IVsDataCommand: Provides the ability to derive and execute various types of commands.

  • IVsDataAsyncCommand: Enables executing data commands in an asynchronous manner.

  • IVsDataTransaction: Provides the ability to begin, commit, and roll back transactions.

  • IVsDataSourceVersionComparer: Provides a method for comparing two data source–specific version strings.

  • IVsDataSourceInformation: Provides a set of well-defined name/value pairs that describe the data source.

  • IVsDataMappedObjectConverter: Enables providing a customized mapper of data source–specific metadata into well-known concepts for use by a generic designer.

  • IVsDataObjectSelector: Enables getting data source–specific metadata about objects defined in the data object support XML file.

  • IDSRefBuilder: Provides the ability to create a Data Source Reference (DSRef) object that identifies one or more data objects.

This class implements the IVsDataSiteableObject<T> interface, which allows DDEX to site a data provider's DataConnectionSupport implementation with the IVsDataConnection object that is calling into it. This provides the implementation with context, as well as a means for retrieving Visual Studio services.

Notes to Inheritors

Any derived class should implement the various abstract properties and methods to support their connection. A derived class should also override the protected CreateService method to provide its implementation of the connection services. When a state-change or message-received event occurs, a derived class should, when possible, call the protected OnStateChanged and OnMessageReceived methods.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Data.Framework Namespace