private void SolutionEvents_OnBeforeCloseSolution() { bool hasXsProject = false; ThreadHelper.JoinableTaskFactory.Run(async delegate { var vsProjects = await VS.Solutions.GetAllProjectsAsync(); foreach (var prj in vsProjects) { if (prj.IsXSharp()) { hasXsProject = true; break; } } }); // close OUR documents that are opened in design mode. if (!hasXsProject) { return; } ThreadHelper.JoinableTaskFactory.Run(async delegate { XSolution.IsClosing = true; XSolution.Close(); var frames = await VS.Windows.GetAllDocumentWindowsAsync(); if (frames != null) { foreach (var frame in frames.ToList()) { if (frame.Caption.EndsWith("]")) { // no need to save here. VS has shown a dialog with the dirty files already await frame.CloseFrameAsync(FrameCloseOption.NoSave); } } } }); return; }
private void SolutionEvents_OnAfterCloseSolution() { XSolution.Close(); XSharpXMLDocTools.Close(); XSolution.IsClosing = false; }
private void ShellEvents_ShutdownStarted() { XSolution.IsClosing = true; XSolution.Close(); }