public async Task AutoSave()
        {
            if (!IsDirty)
            {
                return;
            }
            if (Document == null)
            {
                var    index = 1;
                string path;
                do
                {
                    path = Path.Combine(_workingDirectory, DocumentViewModel.GetAutoSaveName("Program" + index++));
                } while (File.Exists(path));
                Document = DocumentViewModel.CreateAutoSave(path);
            }

            await SaveDocument(Document.GetAutoSavePath()).ConfigureAwait(false);
        }
 private IEnumerable <OpenDocumentViewModel> LoadAutoSavedDocuments(string root)
 {
     return(IOUtilities.EnumerateFilesRecursive(root, DocumentViewModel.GetAutoSaveName("*")).Select(x =>
                                                                                                     GetOpenDocumentViewModel(DocumentViewModel.CreateAutoSave(x))));
 }
Example #3
0
 private IEnumerable <OpenDocumentViewModel> LoadAutoSavedDocuments(string root)
 {
     return(EnumerateFilesWithCatch(root, DocumentViewModel.GetAutoSaveName("*")).Select(x =>
                                                                                         GetOpenDocumentViewModel(DocumentViewModel.CreateAutoSave(x))));
 }