Ejemplo n.º 1
0
        internal Workspace(IWorkspaceServiceProvider workspaceServicesProvider)
        {
            this.primaryBranchId = BranchId.GetNextId();

            this.workspaceServicesProvider = workspaceServicesProvider;

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

            this.taskQueue = workspaceTaskSchedulerFactory.CreateTaskQueue();

            // initialize with empty solution
            this.latestSolution = CreateSolution(SolutionId.CreateNewId());
        }
Ejemplo n.º 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());
        }