Share via


ServiceProviderExtensions.GetCOMService Method

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)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetCOMService ( _
    provider As IServiceProvider, _
    type As Type _
) As Object
public static Object GetCOMService(
    this IServiceProvider provider,
    Type type
)
[ExtensionAttribute]
public:
static Object^ GetCOMService(
    IServiceProvider^ provider, 
    Type^ type
)
static member GetCOMService : 
        provider:IServiceProvider * 
        type:Type -> Object
public static function GetCOMService(
    provider : IServiceProvider, 
    type : Type
) : Object

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).

.NET Framework Security

See Also

Reference

ServiceProviderExtensions Class

Microsoft.VisualStudio.TextTemplating Namespace