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
'宣言
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 | |
---|---|---|
DataConnectionSupport | Initializes a new instance of the DataConnectionSupport class. |
Top
Properties
Name | Description | |
---|---|---|
ConnectionString | Gets or sets a string representation of information required to establish a specified data source connection. | |
ConnectionTimeout | Gets or sets the amount of time to wait when establishing a connection before terminating the attempt and generating a timeout error. | |
ParentProvider | Gets the current instance of the parent service provider. (Inherited from ServiceProvider.) | |
ProviderObject | Gets the underlying data provider, which supports the current data connection. | |
ServiceProvider | Gets the global Visual Studio service provider. | |
Site | Gets or sets the site. (Inherited from DataSiteableServiceProvider<T>.) | |
State | Gets the state of the data connection. |
Top
Methods
Name | Description | |
---|---|---|
AddService(Type, ServiceCreatorCallback) | Adds the specified service to the internal collection of services. (Inherited from ServiceProvider.) | |
AddService(Type, Object) | Adds the specified service to the internal collection of services. (Inherited from ServiceProvider.) | |
AddService(Type, ServiceCreatorCallback, Boolean) | Adds the specified service to the internal collection of services or to the parent service container. (Inherited from ServiceProvider.) | |
AddService(Type, Object, Boolean) | Adds the specified service to the collection of service objects or to the parent service container. (Inherited from ServiceProvider.) | |
Close | Closes the specified connection. | |
CreateService | Creates a new service object, specifying the interface service type. | |
Dispose() | Releases all resources held by the data connection. | |
Dispose(Boolean) | Releases all resources held by the data connection. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Releases all resources held by the data connection when the data connection support object is destroyed. (Overrides Object.Finalize().) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetService(Guid) | Retrieves a service with a specified service GUID. (Inherited from ServiceProvider.) | |
GetService(Type) | Retrieves a service of the specified type. (Inherited from ServiceProvider.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Initialize | Initializes the specified connection, optionally from an existing data provider object. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnMessageReceived | Handles the MessageReceived event. | |
OnSiteChanged | Raises the SiteChanged() event. (Inherited from DataSiteableServiceProvider<T>.) | |
OnStateChanged | Handles the StateChanged event. | |
Open | Opens the specified data connection. | |
RemoveService(Type) | Removes the specified service from the internal services collection (Inherited from ServiceProvider.) | |
RemoveService(Type, Boolean) | Removes the specified service from the internal services collection or from the parent service container. (Inherited from ServiceProvider.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
MessageReceived | Occurs when a message is received from the data source. | |
SiteChanged | Occurs when the site has changed. (Inherited from DataSiteableServiceProvider<T>.) | |
StateChanged | Occurs when the state of the data connection has changed. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
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.