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)
Syntax
'Declaration
Public Function GetGlobalObjects ( _
baseType As Type _
) As GlobalObjectCollection
public GlobalObjectCollection GetGlobalObjects(
Type baseType
)
public:
GlobalObjectCollection^ GetGlobalObjects(
Type^ baseType
)
member GetGlobalObjects :
baseType:Type -> GlobalObjectCollection
public function GetGlobalObjects(
baseType : Type
) : GlobalObjectCollection
Parameters
baseType
Type: System.TypeThe Type of the GlobalObject to filter on.
Return Value
Type: Microsoft.VisualStudio.Shell.Design.GlobalObjectCollection
A GlobalObjectCollection containing the currently available global objects.
Exceptions
Exception | Condition |
---|---|
NotSupportedException | One of the queried global service provider factories returned nulla null reference (Nothing in Visual Basic) provider or provider collection. |
Remarks
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 nulla null reference (Nothing in Visual Basic); 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:
A call to the GetProviders method of the GlobalObjectProviderFactory class is made.
In response, the provider factory creates the required GlobalObjectProvider instances if they do not already exist.
GetProviders returns the array of global object providers.
GetGlobalObjects method calls the GlobalObjectProvider.GetGlobalObjects method for each provider. Finally it aggregates the results which it then returns.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.