次の方法で共有


Package.GetGlobalService Method

Gets a service proffered globally by Visual Studio or one of its packages. This is the same as calling GetService() on an instance of a package that proffers no services itself.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'宣言
Public Shared Function GetGlobalService ( _
    serviceType As Type _
) As Object
'使用
Dim serviceType As Type
Dim returnValue As Object

returnValue = Package.GetGlobalService(serviceType)
public static Object GetGlobalService(
    Type serviceType
)
public:
static Object^ GetGlobalService(
    Type^ serviceType
)
static member GetGlobalService : 
        serviceType:Type -> Object 
public static function GetGlobalService(
    serviceType : Type
) : Object

Parameters

  • serviceType
    Type: System.Type
    The type of the service requested.

Return Value

Type: System.Object
The service being requested if available, otherwise null.

.NET Framework Security

See Also

Reference

Package Class

Package Members

Microsoft.VisualStudio.Shell Namespace