IVsDataHostService Interface
Provides the DDEX Host service.
Namespace: Microsoft.VisualStudio.Data.Core
Assembly: Microsoft.VisualStudio.Data.Core (in Microsoft.VisualStudio.Data.Core.dll)
Syntax
'Declaration
<GuidAttribute("42B51AD0-12B8-409f-BB67-1A381CCAD02E")> _
Public Interface IVsDataHostService
'Usage
Dim instance As IVsDataHostService
[GuidAttribute("42B51AD0-12B8-409f-BB67-1A381CCAD02E")]
public interface IVsDataHostService
[GuidAttribute(L"42B51AD0-12B8-409f-BB67-1A381CCAD02E")]
public interface class IVsDataHostService
public interface IVsDataHostService
Remarks
The DDEX Host service offers a managed way to access global Visual Studio services through a variety of generic methods. This service is easier to call than the QueryService method on the underlying native IServiceProvider implementation supplied by the Visual Studio environment. This service also supplies members that become important when you are carrying out asynchronous operations that are synchronous with the UI thread.
The DDEX Host service is a global Visual Studio service registered with the environment and can thus be accessed by requesting the service from a global service provider object.
Examples
The following code demonstrates how a client can retrieve the DDEX Host service from a global Visual Studio service provider and then retrieve an additional service by using one of the generic methods.
using System;
using System.Diagnostics;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Shell.Interop;
public class DdexHostSvcExample1
{
public static IVsUIShell GetIVsUIShell(IServiceProvider serviceProvider)
{
IVsDataHostService hostService = serviceProvider.GetService(
typeof(IVsDataHostService)) as IVsDataHostService;
return hostService.GetService<IVsUIShell>();
}
}