Export (0) Print
Expand All

ServiceProviderExtensions.GetCOMService Method

Visual Studio 2012

Attempts to return a service from a remote provider enabled for COM interfacing.

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating.Interfaces.11.0 (in Microsoft.VisualStudio.TextTemplating.Interfaces.11.0.dll)

public static Object GetCOMService(
	this IServiceProvider provider,
	Type type
)

Parameters

provider
Type: IServiceProvider

The remote service provider.

type
Type: Type

The type of service being requested.

Return Value

Type: Object
The associated service enabled for COM interfacing if it is possible; otherwise whatever the service provider provides. May return null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IServiceProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Show:
© 2014 Microsoft