IVsDataProvider Interface
Provides a DDEX provider.
Namespace: Microsoft.VisualStudio.Data.Core
Assembly: Microsoft.VisualStudio.Data.Core (in Microsoft.VisualStudio.Data.Core.dll)
Syntax
'Declaration
Public Interface IVsDataProvider
public interface IVsDataProvider
public interface class IVsDataProvider
type IVsDataProvider = interface end
public interface IVsDataProvider
The IVsDataProvider type exposes the following members.
Properties
Name | Description | |
---|---|---|
Description | Gets a description of the DDEX provider. | |
DisplayName | Gets the display name of the DDEX provider. | |
Guid | Gets the unique identifier of the DDEX provider. | |
Name | Gets the programmatic name of the DDEX provider. | |
ShortDisplayName | Gets a short display name of the DDEX provider. | |
Technology | Gets the unique identifier of the underlying technology employed and targeted by the DDEX provider. |
Top
Methods
Name | Description | |
---|---|---|
CreateObject(Type) | Creates an instance of the specified DDEX support entity that is implemented by the DDEX provider. | |
CreateObject(Guid, Type) | Creates an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider. | |
CreateObject<TObject>() | Creates an instance of the specified DDEX support entity that is implemented by the DDEX provider. | |
CreateObject<TObject>(Guid) | Creates an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider. | |
CreateObject<TSite>(Guid, Type, TSite) | Creates an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object. | |
CreateObject<TObject, TSite>(Guid, TSite) | Creates an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object. | |
DeriveSource | Derives a DDEX data source that is supported by the DDEX provider, given information about a target data source. | |
GetAssembly(String) | Resolves a provider-specific assembly string to its corresponding Assembly representation. | |
GetAssembly(Guid, String) | Resolves a provider-specific assembly string to its corresponding Assembly representation, for a specific DDEX data source. | |
GetMainAssembly | Gets the provider’s main assembly. | |
GetProperty | Gets a registered property of the DDEX provider. | |
GetString | Gets a localized string from the DDEX provider. | |
GetType(String) | Resolves a provider-specific type name to its corresponding Type representation. | |
GetType(Guid, String) | Resolves a provider-specific type name to its corresponding Type representation, for a specific DDEX data source. | |
GetUnsupportedReason(CommandID, Object) | Gets a localized string that explains why an operation is not supported. | |
GetUnsupportedReason(Guid, CommandID, Object) | Gets a localized string that explains why an operation is not supported for the specified DDEX data source. | |
IsOperationSupported(CommandID, Object) | Determines whether a specific operation is supported by the provider in the current environment. | |
IsOperationSupported(Guid, CommandID, Object) | Determines whether a specific operation is supported by the provider in the current environment, for the specified DDEX data source. | |
SupportsObject(Type) | Determines whether a DDEX provider supports the specified type of DDEX support entity. | |
SupportsObject(Guid, Type) | Determines whether a DDEX provider supports the specified type of DDEX support entity for the specified DDEX data source. | |
TryCreateObject(Type) | Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider. | |
TryCreateObject(Guid, Type) | Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider. | |
TryCreateObject<TObject>() | Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider. | |
TryCreateObject<TObject>(Guid) | Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider. | |
TryCreateObject<TSite>(Guid, Type, TSite) | Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object. | |
TryCreateObject<TObject, TSite>(Guid, TSite) | Tries to create an instance of the specified DDEX support entity for the specified DDEX data source that is implemented by the DDEX provider, sited with the specified site object. |
Top
Remarks
A DDEX provider object supplies information about a provider that is registered in the Visual Studio environment. It is the entry point for DDEX clients to interact with a DDEX provider. Each provider has a unique GUID that distinguishes it from all others, in addition to a variety of names and a description. This interface supplies a set of properties that define custom characteristics of the provider, in addition to a method that retrieves localized strings when given a resource ID string that is provider-specific. It also supplies a method for determining a DDEX data source when given a connection string that contains information about the target data source. It supplies methods for identifying and creating DDEX support entities implemented by the provider. Finally, it supplies resolution methods for managed types and assemblies that are owned by the provider.
A DDEX provider object can be retrieved by using the IVsDataProviderManager service.
Examples
The following code demonstrates how a client can retrieve a specific DDEX provider and output its display name and description, and then create one of the standard DDEX support entities.
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");
}
}