IComponentModel.GetService<T> Method

Gets a "service" from the default composition container, i.e. an object of which there can only a single instance exist in a given composition container.

Namespace:  Microsoft.VisualStudio.ComponentModelHost
Assembly:  Microsoft.VisualStudio.ComponentModelHost (in Microsoft.VisualStudio.ComponentModelHost.dll)

Syntax

声明
Function GetService(Of T As Class) As T
用法
Dim instance As IComponentModel
Dim returnValue As T

returnValue = instance.GetService()
T GetService<T>()
where T : class
generic<typename T>
where T : ref class
T GetService()
abstract GetService : unit -> 'T  when 'T : not struct
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of service.

Return Value

Type: T

Remarks

Calling this method is the same as calling GetExportedValue.

.NET Framework Security

See Also

Reference

IComponentModel Interface

IComponentModel Members

Microsoft.VisualStudio.ComponentModelHost Namespace