IVsDataSource.GetProviders Method

Gets the DDEX providers that support this DDEX data source.

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

Syntax

Function GetProviders As Guid()

Dim instance As IVsDataSource
Dim returnValue As Guid()

returnValue = instance.GetProviders()
Guid[] GetProviders()
array<Guid>^ GetProviders()
function GetProviders() : Guid[]

Return Value

Type: array<System.Guid[]

An array of DDEX provider identifiers that represent the valid, registered DDEX providers that support this DDEX data source.

Remarks

A DDEX data source is defined only by registry entries and does not have any implementation associated with it. Instead, one or more DDEX providers offer support for the DDEX data source. It is here that implementation is supplied. This method enables DDEX clients to access the one-to-many mapping between DDEX data sources and supporting DDEX providers.

This method reads the list of supporting providers by opening the SupportingProviders key underneath the registration of the DDEX data source in the Visual Studio local registry hive. Subkeys are expected to be valid GUID strings, and any that are regarded as invalid are ignored. Additionally, DDEX providers listed that are not registered or not available in the current environment are not returned by this method.

Examples

The following code demonstrates how a client can retrieve a specific DDEX data source and output the names of each supporting DDEX provider.

using System;
using System.Diagnostics;
using Microsoft.VisualStudio.Data.Core;

public class DDEX_IVsDataSourceExample3
{
    public static void OutputSupportingProviders(
        IServiceProvider serviceProvider,
        IVsDataSource dataSource)
    {
        IVsDataProviderManager providerManager =
            serviceProvider.GetService(typeof(IVsDataProviderManager))
                as IVsDataProviderManager;
        foreach (Guid providerGuid in dataSource.GetProviders())
        {
            IVsDataProvider provider = providerManager.Providers[providerGuid];
            Trace.WriteLine(provider.Name);
        }
    }
}

Permissions

See Also

Reference

IVsDataSource Interface

IVsDataSource Members

Microsoft.VisualStudio.Data.Core Namespace