GlobalObjectProvider.GetService Method

Gets the requested service.

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

Syntax

'宣言
Protected Function GetService ( _
    serviceType As Type _
) As Object
'使用
Dim serviceType As Type
Dim returnValue As Object

returnValue = Me.GetService(serviceType)
protected Object GetService(
    Type serviceType
)
protected:
Object^ GetService(
    Type^ serviceType
)
protected function GetService(
    serviceType : Type
) : Object

Parameters

Return Value

Type: System.Object

An Object that represents an instance of the requested service; otherwise, a null reference (Nothing in Visual Basic) if no such service exists.

Exceptions

Exception Condition
ArgumentNullException

serviceType is a null reference (Nothing in Visual Basic).

Remarks

The default implementation of the GetService method delegates the request to the IServiceProvider that is set by the SetSite(Object) method.

Permissions

See Also

Reference

GlobalObjectProvider Class

GlobalObjectProvider Members

Microsoft.VisualStudio.Shell.Design Namespace

IServiceProvider

SetSite(Object)