Example #1
0
        public void CloseDocumentsForProject(IProject project)
        {
            var documentsToClose = DocumentTabs.Documents.ToList();

            foreach (var document in documentsToClose)
            {
                if (document is EditorViewModel evm && evm.SourceFile.Project == project)
                {
                    DocumentTabs.CloseDocument(evm);
                }
            }
        }
Example #2
0
        public void RemoveDocument(IDocumentTabViewModel document)
        {
            if (document == null)
            {
                return;
            }

            if (document is EditorViewModel doc)
            {
                doc.Editor?.Save();
            }

            DocumentTabs.CloseDocument(document);
        }
Example #3
0
        public void CloseSolution()
        {
            var documentsToClose = DocumentTabs.Documents.ToList();

            foreach (var document in documentsToClose)
            {
                if (document is EditorViewModel evm)
                {
                    DocumentTabs.CloseDocument(evm);
                }
            }

            CurrentSolution = null;
        }
        public async Task CloseSolutionAsync()
        {
            var documentsToClose = DocumentTabs.Documents.ToList();

            foreach (var document in documentsToClose)
            {
                if (document is EditorViewModel evm)
                {
                    DocumentTabs.CloseDocument(evm);
                }
            }

            await CurrentSolution.UnloadProjectsAsync();

            await CurrentSolution.UnloadSolutionAsync();

            CurrentSolution = null;
        }