GlobalObjectProvider::GetGlobalObjects Method (Project^, Type^)
Gets a collection of global objects for the specified project that match the specified type.
Assembly: Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)
Parameters
- project
-
Type:
EnvDTE::Project^
The Project to obtain global objects from.
- baseType
-
Type:
System::Type^
The Type of the GlobalObject to filter on. Can be null to indicate no filtering.
Return Value
Type: Microsoft.VisualStudio.Shell.Design::GlobalObjectCollection^A GlobalObjectCollection containing the global objects of the specified Type for the specified project.
| Exception | Condition |
|---|---|
| ArgumentNullException | project is null. |
| InvalidOperationException | The implementation of GetGlobalObjectsCore returned null. |
The GetGlobalObjects method provides a standard wrapper for the GetGlobalObjectsCore method. GetGlobalObjects will ignore all except the most critical exceptions thrown by the core method, namely NullReferenceException, StackOverflowException, OutOfMemoryException and ThreadAbortException.
Use the GetGlobalObjects method instead of the GetGlobalObjectsCore method since the former always returns a list even if the list is empty.