Skip to content

Commit

Permalink
*fix: DirectoryWatcher did not react on file renames (which is requir…
Browse files Browse the repository at this point in the history
…ed for integration with nextcloud).

(Version 1.3)
  • Loading branch information
Pixinger committed Dec 27, 2022
1 parent 316ae86 commit bb4453a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions DcsMissionValidator/DirectoryWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public DirectoryWatcher(string directory, EventHandler<FileChangedEventArg> onFi
this._Watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
this._Watcher.Created += this.OnFileChanged;
this._Watcher.Changed += this.OnFileChanged;
this._Watcher.Renamed += this.OnFileRenamed;
this._Watcher.IncludeSubdirectories = true;
this._Watcher.EnableRaisingEvents = true;
}
Expand Down Expand Up @@ -80,6 +81,7 @@ protected virtual void OnDispose(bool disposing)
Logger.Debug("DirectoryWatcher disposed");
}

private void OnFileRenamed(object source, FileSystemEventArgs e) => OnFileChanged(source, e);
private void OnFileChanged(object source, FileSystemEventArgs e)
{
if (!string.IsNullOrWhiteSpace(e.FullPath))
Expand Down
2 changes: 1 addition & 1 deletion DcsMissionValidator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.*")]
[assembly: AssemblyVersion("1.3.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

0 comments on commit bb4453a

Please sign in to comment.