public void OnAfterCloseSolution() { AssertIsForeground(); if (_deferredLoadWasEnabledForLastSolution) { // Copy to avoid modifying the collection while enumerating var loadedProjects = ImmutableProjects.ToList(); foreach (var p in loadedProjects) { p.Disconnect(); } } lock (_gate) { Contract.ThrowIfFalse(_projectMap.Count == 0); } NotifyWorkspaceHosts(host => host.OnSolutionRemoved()); NotifyWorkspaceHosts(host => host.ClearSolution()); lock (_gate) { _projectPathToIdMap.Clear(); } foreach (var workspaceHost in _workspaceHosts) { workspaceHost.SolutionClosed(); } _solutionIsClosing = false; }
int IVsSolutionEvents.OnAfterCloseSolution(object pUnkReserved) { AssertIsForeground(); if (IsDeferredSolutionLoadEnabled()) { // Copy to avoid modifying the collection while enumerating var loadedProjects = ImmutableProjects.ToList(); foreach (var p in loadedProjects) { p.Disconnect(); } } lock (_gate) { Contract.ThrowIfFalse(_projectMap.Count == 0); } NotifyWorkspaceHosts_Foreground(host => host.OnSolutionRemoved()); NotifyWorkspaceHosts_Foreground(host => host.ClearSolution()); lock (_gate) { _projectPathToIdMap.Clear(); } foreach (var workspaceHost in _workspaceHosts) { workspaceHost.SolutionClosed(); } _solutionIsClosing = false; return(VSConstants.S_OK); }