Skip to content

Commit

Permalink
Removed a filter from teh FileWatcher to see if this works better
Browse files Browse the repository at this point in the history
  • Loading branch information
Baudin999 committed Dec 26, 2019
1 parent e4430ff commit 7fe9b0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions Project/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 1 addition & 2 deletions Project/ProjectFilesWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down

0 comments on commit 7fe9b0b

Please sign in to comment.