diff --git a/Project/Module.cs b/Project/Module.cs index ac22570..46c0d69 100644 --- a/Project/Module.cs +++ b/Project/Module.cs @@ -172,16 +172,11 @@ private string ReadModuleText() } private async Task SaveResult(string fileName, string source) - { - var filePath = System.IO.Path.GetFullPath(fileName, OutPath); - System.IO.Directory.CreateDirectory(OutPath); - await WriteAllTextAsync(filePath, source); - } - - private async Task WriteAllTextAsync(string fileName, string source) { try { + var filePath = System.IO.Path.GetFullPath(fileName, OutPath); + Directory.CreateDirectory(OutPath); using (var fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)) { using (var sr = new StreamWriter(fs)) diff --git a/Project/ProjectFilesWatcher.cs b/Project/ProjectFilesWatcher.cs index 9c01feb..7b73bd7 100644 --- a/Project/ProjectFilesWatcher.cs +++ b/Project/ProjectFilesWatcher.cs @@ -24,8 +24,7 @@ public void Start() // Watch for changes in LastAccess and LastWrite times, and // the renaming of files or directories. - NotifyFilter = NotifyFilters.LastAccess - | NotifyFilters.LastWrite + NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName,