Example #1
0
        /// <summary>
        /// Remove a project from the workspace.
        /// </summary>
        internal void RemoveProject(AbstractProject project)
        {
            Contract.ThrowIfFalse(_projectMap.Remove(project.Id));

            UpdateProjectBinPath(project, project.TryGetBinOutputPath(), null);

            if (project.PushingChangesToWorkspaceHosts)
            {
                NotifyWorkspaceHosts(host => host.OnProjectRemoved(project.Id));
            }
        }
Example #2
0
        /// <summary>
        /// Remove a project from the workspace.
        /// </summary>
        internal void RemoveProject(AbstractProject project)
        {
            Contract.ThrowIfFalse(_projectMap.Remove(project.Id));

            UpdateProjectBinPath(project, project.TryGetBinOutputPath(), null);

            using (Dispatcher.CurrentDispatcher.DisableProcessing())
            {
                foreach (var hostState in _workspaceHosts)
                {
                    hostState.RemoveProject(project);
                }
            }
        }
Example #3
0
        /// <summary>
        /// Add a project to the workspace.
        /// </summary>
        internal void AddProject(AbstractProject project)
        {
            _projectMap.Add(project.Id, project);

            UpdateProjectBinPath(project, null, project.TryGetBinOutputPath());

            if (_solutionLoadComplete)
            {
                StartPushingToWorkspaceAndNotifyOfOpenDocuments(SpecializedCollections.SingletonEnumerable(project));
            }
            else
            {
                _projectsLoadedThisBatch.Add(project);
            }
        }
Example #4
0
        protected void UpdateProjectReferenceAliases(AbstractProject referencedProject, ImmutableArray<string> aliases)
        {
            var projectReference = GetCurrentProjectReferences().Single(r => r.ProjectId == referencedProject.Id);

            var newProjectReference = new ProjectReference(referencedProject.Id, aliases, projectReference.EmbedInteropTypes);

            // Is this a project with converted references? If so, make sure we track it
            string referenceBinPath = referencedProject.TryGetBinOutputPath();
            if (referenceBinPath != null && _metadataFileNameToConvertedProjectReference.ContainsKey(referenceBinPath))
            {
                _metadataFileNameToConvertedProjectReference[referenceBinPath] = newProjectReference;
            }

            // Remove the existing reference first
            RemoveProjectReference(projectReference);

            AddProjectReference(newProjectReference);
        }
        /// <summary>
        /// Remove a project from the workspace.
        /// </summary>
        internal void RemoveProject(AbstractProject project)
        {
            Contract.ThrowIfFalse(_projectMap.Remove(project.Id));

            UpdateProjectBinPath(project, project.TryGetBinOutputPath(), null);

            if (project.PushingChangesToWorkspaceHosts)
            {
                NotifyWorkspaceHosts(host => host.OnProjectRemoved(project.Id));
            }
        }
        /// <summary>
        /// Add a project to the workspace.
        /// </summary>
        internal void AddProject(AbstractProject project)
        {
            _projectMap.Add(project.Id, project);

            UpdateProjectBinPath(project, null, project.TryGetBinOutputPath());

            if (_solutionLoadComplete)
            {
                StartPushingToWorkspaceAndNotifyOfOpenDocuments(SpecializedCollections.SingletonEnumerable(project));
            }
            else
            {
                _projectsLoadedThisBatch.Add(project);
            }
        }