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
'Declaration
Function GetProviders As Guid()
Guid[] GetProviders()
array<Guid>^ GetProviders()
abstract GetProviders : unit -> Guid[]
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);
}
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.