PackageUtilities.QueryService<TService> Method (IServiceProvider)

Visual Studio 2015
 

Gets a service exposed by a service provider based on its service type.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public static object QueryService<TService>(
	this IServiceProvider serviceProvider
)

Parameters

serviceProvider
Type: Microsoft.VisualStudio.OLE.Interop.IServiceProvider

The service provider to query.

Return Value

Type: System.Object

The service, if found; otherwise null.

Type Parameters

TService

The type whose GuidAttribute specifies the service GUID to query for.

Return to top
Show: