We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am currently implementing some asynchronous event handling:
foreach ((string path, WFileParser parser) in files) { FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = Path.GetDirectoryName(Path.GetFullPath(path))!; watcher.Filter = Path.GetFileName(path); watcher.NotifyFilter = NotifyFilters.LastWrite; watcher.Changed += WatchChanges; watcher.Deleted += WatchRemoval; watcher.Renamed += WatchRemoval; string fullPath = Path.Combine(watcher.Path, watcher.Filter); PromptPlus.WriteLine($"Watching path \"{fullPath}\"..."); _activeWatchers.TryAdd(fullPath, (watcher, parser)); watcher.EnableRaisingEvents = true; } // PromptPlus.WriteLine($"Watching {dict.Count} path(s) for changes."); PromptPlus.WriteLine($"Watching {files.Count} path(s) for changes."); PromptPlus.KeyPress(@"Press any key to stop watching files... ").Run();
private static void WatchRemoval(object sender, FileSystemEventArgs e) { PromptPlus.WriteLine($"Path {Path.GetFileName(e.Name)} was renamed or deleted, aborting watch."); _activeWatchers[e.FullPath].Item1.EnableRaisingEvents = false; _activeWatchers.Remove(e.FullPath); } private static void WatchChanges(object sender, FileSystemEventArgs e) { PromptPlus.WriteLine($"Detected change in {e.Name}."); Catcher.Catch(() => ParseMode.Repack(e.FullPath, _activeWatchers[e.FullPath].Item2, false, out _), out _, e.FullPath); }
This results in the following output:
When one of the event handlers responds, new text is printed:
But if I then "press any key", the following output overwrites those lines from the original position of the "Press any key" prompt.
Do you have advice on how to handle this?
The text was updated successfully, but these errors were encountered:
FRACerqueira
No branches or pull requests
I am currently implementing some asynchronous event handling:
This results in the following output:
When one of the event handlers responds, new text is printed:
But if I then "press any key", the following output overwrites those lines from the original position of the "Press any key" prompt.
Do you have advice on how to handle this?
The text was updated successfully, but these errors were encountered: