| ServiceProviderExtensionsGetServiceTService Method (IServiceProvider) |
Namespace: Tvl.VisualStudio.ShellAssembly: Tvl.VisualStudio.ShellServices.10 (in Tvl.VisualStudio.ShellServices.10.dll) Version: 2.0.0.0
Syntax public static TService GetService<TService>(
this IServiceProvider serviceProvider
)
<ExtensionAttribute>
Public Shared Function GetService(Of TService) (
serviceProvider As IServiceProvider
) As TService
public:
[ExtensionAttribute]
generic<typename TService>
static TService GetService(
IServiceProvider^ serviceProvider
)
static member GetService :
serviceProvider : IServiceProvider -> 'TService
Parameters
- serviceProvider
- Type: SystemIServiceProvider
The service provider.
Type Parameters
- TService
- The type of service to locate.
Return Value
Type:
TServiceAn instance of the service, or
if the service provider was unable to provide the service.
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).
Exceptions See Also