You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensibility/visualstudio.extensibility/project/project.md
+1-36Lines changed: 1 addition & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,34 +54,19 @@ This overview covers top scenarios for working with the project query API:
54
54
-[Action Query to Save a Solution/Project](#action-query-to-save-solutionsprojects)
55
55
-[Query to Subscribe to Query Changes](#query-to-subscribe-to-query-changes)
56
56
-[Query to Track Query Changes](#query-to-track-query-changes)
57
-
-[Events to monitor solution open and close](#events-to-monitor-solution-open-and-close)
58
57
-[Action Query to Skip](#action-query-to-skip)
59
58
60
59
## Access the project query space
61
60
62
61
You'll need to obtain an instance of the *project query space* object to query the project system. This object has several asynchronous methods that query or update the project system. The term *project query space* and the term *workspace* both mean the same thing and refer to the object that provides access to all the data for a project. `workspace` will be consistently used in this documentation.
63
62
64
-
There are two approaches to accessing the project query space: **WorkspacesExtensibility** and **ProjectQueryableSpace**.
65
-
66
-
### Using WorkspacesExtensibility (Recommended)
63
+
### Using WorkspacesExtensibility
67
64
The `WorkspacesExtensibility` object, built into `Microsoft.VisualStudio.Extensibility`, provides a simple and integrated way to use project query.
Alternatively, you can use a `ProjectQueryableSpace` object created via a service broker. This approach is useful for scenarios requiring more control or integration with specific services.
In the example above, `context` refers to an instance of `IClientContext` provided by `Microsoft.VisualStudio.Extensibility`. It is used to access contextual information and services related to the current state and environment of the IDE.
82
-
83
-
For those utilizing the service broker, consult the [Project Query API article for Visual Studio SDK](../../project-visual-studio-sdk.md) for detailed queries.
84
-
85
70
## Query the project system for a project
86
71
87
72
The [`WorkspacesExtensibility`](/dotnet/api/microsoft.visualstudio.extensibility.workspacesextensibility) object lets you query for an individual project: if you have the project GUID. There are usually two GUIDs associated with a project, one that represents the project type, and other that uniquely represents the project. You can find the project's unique GUID in the solution file, or from an extension, you can query for the `Guid` property as demonstrated in the next section.
@@ -702,26 +687,6 @@ private class TrackerObserver : IObserver<IQueryTrackUpdates<IFileSnapshot>>
702
687
}
703
688
```
704
689
705
-
## Events to monitor solution open and close
706
-
707
-
The `QueryableSpaceChanged` event can be subscribed to for monitoring when solutions open and close using a workspace created with a service broker. `ProjectQueryableSpaceChangedEventArgs` contains two fields, `SolutionPath` and `QueryableSpaceVersion`. The string `SolutionPath` is the path the solution that opened or null if a solution closed. The int `QueryableSpaceVersion` increments as solutions are opened or closed.
0 commit comments