MetalamaAPI documentationIntrospection APIMetalama.​Framework.​WorkspacesWorkspace­Collection
Open sandboxFocus

WorkspaceCollection Class

Represents a set of workspaces. Two attempts to load a workspace with the same parameters, in the same WorkspaceCollection, will return the exact same instance, unless the Reset() method is called.

Inheritance
WorkspaceCollection
Namespace: Metalama.Framework.Workspaces
Assembly: Metalama.Framework.Workspaces.dll
Syntax
public sealed class WorkspaceCollection : Object

Constructors

Name Description
WorkspaceCollection(Nullable<GlobalServiceProvider>)

Initializes a new instance of the WorkspaceCollection class.

Properties

Name Description
Default

Gets the default instance of the WorkspaceCollection class. This is a singleton instance constructed without specifying a service provider.

ServiceBuilder

Methods

Name Description
Load(String[])

Loads a set of projects of solutions into a Workspace, or returns an existing workspace if the method has been previously called with the exact same parameters.

LoadAsync(ImmutableArray<String>, ImmutableDictionary<String, String>, Boolean, CancellationToken)

Asynchronously loads a set of projects of solutions into a Workspace, or returns an existing workspace if the method has been previously called with the exact same parameters. This overload allows to specify MSBuild properties.

LoadAsync(String[])

Asynchronously loads a set of projects of solutions into a Workspace, or returns an existing workspace if the method has been previously called with the exact same parameters.

Reset()

Removes all cached workspaces, but not the set of registered services.

TryFindProject(Compilation, out Workspace, out Project, out Boolean)

Finds the Workspace and Project that defines a given Roslyn Microsoft.CodeAnalysis.Compilation in the current WorkspaceCollection.