Skip to content

Commit

Permalink
Improved complex event handling in FileWatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Kir-Antipov committed Apr 5, 2024
1 parent 3778404 commit b36ec66
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 177 deletions.
7 changes: 1 addition & 6 deletions src/HotAvalonia/AvaloniaHotReloadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ namespace HotAvalonia;
/// </summary>
public sealed class AvaloniaHotReloadContext : IDisposable
{
/// <summary>
/// File extensions to watch
/// </summary>
private static readonly IEnumerable<string> ExtensionsToWatch = [".axaml"];

/// <summary>
/// The Avalonia control managers, mapped by their respective file paths.
/// </summary>
Expand Down Expand Up @@ -44,7 +39,7 @@ private AvaloniaHotReloadContext(string rootPath, IEnumerable<AvaloniaControlInf
.Select(x => ResolveControlManager(x, rootPath))
.ToDictionary(static x => x.FileName, FileHelper.FileNameComparer);

_watcher = new(rootPath, _controls.Keys, ExtensionsToWatch);
_watcher = new(rootPath, _controls.Keys);
_watcher.Changed += OnChanged;
_watcher.Moved += OnMoved;
_watcher.Error += OnError;
Expand Down
Loading

0 comments on commit b36ec66

Please sign in to comment.