Beispiel #1
0
        protected Workspace(HostServices host)
        {
            _services = host.CreateWorkspaceServices(this);

            // queue used for sending events
            var workspaceTaskSchedulerFactory = _services.GetRequiredService <IWorkspaceTaskSchedulerFactory>();

            _taskQueue = workspaceTaskSchedulerFactory.CreateEventingTaskQueue();

            // initialize with empty document set
            _latestDocuments = new WorkspaceDocuments(ImmutableDictionary <DocumentId, Document> .Empty);
        }
Beispiel #2
0
        /// <summary>
        /// Constructs a new workspace instance.
        /// </summary>
        /// <param name="host">The <see cref="HostServices"/> this workspace uses</param>
        /// <param name="workspaceKind">A string that can be used to identify the kind of workspace. Usually this matches the name of the class.</param>
        protected Workspace(HostServices host, string workspaceKind)
        {
            this.primaryBranchId = BranchId.GetNextId();
            this.workspaceKind   = workspaceKind;

            this.services = host.CreateWorkspaceServices(this);

            // queue used for sending events
            var workspaceTaskSchedulerFactory = this.services.GetService <IWorkspaceTaskSchedulerFactory>();

            this.taskQueue = workspaceTaskSchedulerFactory.CreateTaskQueue();

            // initialize with empty solution
            this.latestSolution = CreateSolution(SolutionId.CreateNewId());
        }