private void OnWatcherOnChange(WatcherChangeType type, string path, string oldPath) { switch (type) { case WatcherChangeType.Created: { Console.WriteLine("Created: " + path); break; } case WatcherChangeType.Deleted: { Console.WriteLine("Deleted: " + path); break; } case WatcherChangeType.Changed: { Console.WriteLine("Changed: " + path); break; } case WatcherChangeType.Renamed: { Console.WriteLine("Renamed: " + path + " | " + oldPath); break; } default: { throw new ArgumentOutOfRangeException(nameof(type), type, null); } } }
private void OnChange(WatcherChangeType changetype, [NotNull] string fullpath, string oldpath) { Change?.Invoke(changetype, fullpath, oldpath); }