Partager via


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
Public property Description Gets a description of the DDEX provider.
Public property DisplayName Gets the display name of the DDEX provider.
Public property Guid Gets the unique identifier of the DDEX provider.
Public property Name Gets the programmatic name of the DDEX provider.
Public property ShortDisplayName Gets a short display name of the DDEX provider.
Public property Technology Gets the unique identifier of the underlying technology employed and targeted by the DDEX provider.

Top

Methods

  Name Description
Public method CreateObject(Type) Creates an instance of the specified DDEX support entity that is implemented by the DDEX provider.
Public method 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.
Public method CreateObject<TObject>() Creates an instance of the specified DDEX support entity that is implemented by the DDEX provider.
Public method 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.
Public method 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.
Public method 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.
Public method DeriveSource Derives a DDEX data source that is supported by the DDEX provider, given information about a target data source.
Public method GetAssembly(String) Resolves a provider-specific assembly string to its corresponding Assembly representation.
Public method GetAssembly(Guid, String) Resolves a provider-specific assembly string to its corresponding Assembly representation, for a specific DDEX data source.
Public method GetMainAssembly Gets the provider’s main assembly.
Public method GetProperty Gets a registered property of the DDEX provider.
Public method GetString Gets a localized string from the DDEX provider.
Public method GetType(String) Resolves a provider-specific type name to its corresponding Type representation.
Public method GetType(Guid, String) Resolves a provider-specific type name to its corresponding Type representation, for a specific DDEX data source.
Public method GetUnsupportedReason(CommandID, Object) Gets a localized string that explains why an operation is not supported.
Public method GetUnsupportedReason(Guid, CommandID, Object) Gets a localized string that explains why an operation is not supported for the specified DDEX data source.
Public method IsOperationSupported(CommandID, Object) Determines whether a specific operation is supported by the provider in the current environment.
Public method IsOperationSupported(Guid, CommandID, Object) Determines whether a specific operation is supported by the provider in the current environment, for the specified DDEX data source.
Public method SupportsObject(Type) Determines whether a DDEX provider supports the specified type of DDEX support entity.
Public method SupportsObject(Guid, Type) Determines whether a DDEX provider supports the specified type of DDEX support entity for the specified DDEX data source.
Public method TryCreateObject(Type) Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.
Public method 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.
Public method TryCreateObject<TObject>() Tries to create an instance of the specified DDEX support entity that is implemented by the DDEX provider.
Public method 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.
Public method 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.
Public method 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");
    }
}

See Also

Reference

Microsoft.VisualStudio.Data.Core Namespace