GlobalObjectService::GetGlobalObjects Method (Type^)

 

Returns a collection of currently available global objects that are of the specified type.

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

public:
GlobalObjectCollection^ GetGlobalObjects(
	Type^ baseType
)

Parameters

baseType
Type: System::Type^

The Type of the GlobalObject to filter on.

Return Value

Type: Microsoft.VisualStudio.Shell.Design::GlobalObjectCollection^

A GlobalObjectCollection containing the currently available global objects.

Exception Condition
NotSupportedException

One of the queried global service provider factories returned null provider or provider collection.

The GetGlobalObjects(Type^) method returns a GlobalObjectCollection of the currently available instances of the GlobalObject class that are of the type specified by the baseType parameter. This collection is created each time this method is called. When the method is called, the method synchronizes the collection with the set of global object providers.

GetGlobalObjects never returns null; if there are no currently available global objects, this method returns an empty collection.

GetGlobalObjects is typically used by design-time tools to initiate the following set of actions:

  1. A call to the GetProviders method of the GlobalObjectProviderFactory class is made.

  2. In response, the provider factory creates the required GlobalObjectProvider instances if they do not already exist.

  3. GetProviders returns the array of global object providers.

  4. GetGlobalObjects method calls the GlobalObjectProvider::GetGlobalObjects method for each provider. Finally it aggregates the results which it then returns.

Return to top
Show: