Click or drag to resize

AdhocWorkspace Class



A workspace that allows full manipulation of projects and documents, but does not persist changes.
Inheritance Hierarchy

Namespace:  Microsoft.CodeAnalysis
Assembly:  Microsoft.CodeAnalysis.Workspaces (in Microsoft.CodeAnalysis.Workspaces.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public sealed class AdhocWorkspace : Workspace

The AdhocWorkspace type exposes the following members.

Constructors
  NameDescription
Public methodAdhocWorkspace
Initializes a new instance of the AdhocWorkspace class
Public methodAdhocWorkspace(HostServices, String)
Initializes a new instance of the AdhocWorkspace class
Top
Properties
  NameDescription
Public propertyCanOpenDocuments (Overrides WorkspaceCanOpenDocuments.)
Public propertyCurrentSolution
The current solution. The solution is an immutable model of the current set of projects and source documents. It provides access to source text, syntax trees and semantics. This property may change as the workspace reacts to changes in the environment or after TryApplyChanges(Solution) is called.
(Inherited from Workspace.)
Public propertyKind
The kind of the workspace. This is generally Host if originating from the host environment, but may be any other name used for a specific kind of workspace.
(Inherited from Workspace.)
Public propertyOptions
Gets or sets the set of all global options.
(Inherited from Workspace.)
Public propertyServices
Services provider by the host for implementing workspace features.
(Inherited from Workspace.)
Top
Methods
  NameDescription
Public methodAddDocument(DocumentInfo)
Adds a document to the workspace.
Public methodAddDocument(ProjectId, String, SourceText)
Adds a document to the workspace.
Public methodAddProject(ProjectInfo)
Adds a project to the workspace. All previous projects remain intact.
Public methodAddProject(String, String)
Adds a project to the workspace. All previous projects remain intact.
Public methodAddProjects
Public methodAddSolution
Adds an entire solution to the workspace, replacing any existing solution.
Public methodCanApplyChange (Overrides WorkspaceCanApplyChange(ApplyChangesKind).)
Public methodClearSolution
Clears all projects and documents from the workspace.
Public methodCloseAdditionalDocument
Puts the specified additional document into the closed state
(Overrides WorkspaceCloseAdditionalDocument(DocumentId).)
Public methodCloseDocument
Puts the specified document into the closed state.
(Overrides WorkspaceCloseDocument(DocumentId).)
Public methodDispose
Disposes this workspace. The workspace can longer be used after it is disposed.
(Inherited from Workspace.)
Public methodGetDocumentIdInCurrentContext
Gets the id for the document associated with the given text container in its current context. Documents are normally associated with a text container when the documents are opened.
(Inherited from Workspace.)
Public methodGetOpenDocumentIds (Inherited from Workspace.)
Public methodGetRelatedDocumentIds (Inherited from Workspace.)
Public methodIsDocumentOpen
Determines if the document is currently open in the host environment.
(Inherited from Workspace.)
Public methodOpenAdditionalDocument
Puts the specified additional document into the open state.
(Overrides WorkspaceOpenAdditionalDocument(DocumentId, Boolean).)
Public methodOpenDocument
Puts the specified document into the open state.
(Overrides WorkspaceOpenDocument(DocumentId, Boolean).)
Public methodTryApplyChanges
Apply changes made to a solution back to the workspace. The specified solution must be one that originated from this workspace. If it is not, or the workspace has been updated since the solution was obtained from the workspace, then this method returns false. This method will still throw if the solution contains changes that are not supported according to the CanApplyChange(ApplyChangesKind) method.
(Inherited from Workspace.)
Top
Events
  NameDescription
Public eventDocumentActiveContextChanged
An event that is fired when the active context document associated with a buffer changes.
(Inherited from Workspace.)
Public eventDocumentClosed
An event that is fired when a document is closed in the editor.
(Inherited from Workspace.)
Public eventDocumentOpened
An event that is fired when a documents is opened in the editor.
(Inherited from Workspace.)
Public eventWorkspaceChanged
An event raised whenever the current solution is changed.
(Inherited from Workspace.)
Public eventWorkspaceFailed
An event raised whenever the workspace or part of its solution model fails to access a file or other external resource.
(Inherited from Workspace.)
Top
See Also