49 references to ChangeKind
Microsoft.DotNet.HotReload.Watch (49)
Build\FilePathExclusions.cs (1)
85
internal bool IsExcluded(string fullPath,
ChangeKind
changeKind, ILogger logger)
FileWatcher\ChangeKind.cs (6)
17
public static HotReloadFileChangeKind Convert(this
ChangeKind
changeKind) =>
20
ChangeKind
.Update => HotReloadFileChangeKind.Update,
21
ChangeKind
.Add => HotReloadFileChangeKind.Add,
22
ChangeKind
.Delete => HotReloadFileChangeKind.Delete,
27
internal readonly record struct ChangedFile(FileItem Item,
ChangeKind
Kind);
29
internal readonly record struct ChangedPath(string Path,
ChangeKind
Kind);
FileWatcher\DirectoryWatcher.cs (1)
23
protected void NotifyChange(string fullPath,
ChangeKind
kind)
FileWatcher\EventBasedDirectoryWatcher.cs (7)
69
NotifyChange(oldLocation,
ChangeKind
.Delete);
70
NotifyChange(newLocation,
ChangeKind
.Add);
75
NotifyChange(e.OldFullPath,
ChangeKind
.Delete);
76
NotifyChange(e.FullPath,
ChangeKind
.Add);
97
NotifyChange(e.FullPath,
ChangeKind
.Delete);
117
NotifyChange(e.FullPath,
ChangeKind
.Update);
136
NotifyChange(e.FullPath,
ChangeKind
.Add);
FileWatcher\PollingDirectoryWatcher.cs (5)
20
private readonly Dictionary<string,
ChangeKind
> _changesBuilder = new(PathUtilities.OSSpecificPathComparer);
103
_changesBuilder.TryAdd(filePath,
ChangeKind
.Add);
107
_changesBuilder.TryAdd(filePath,
ChangeKind
.Update);
117
_changesBuilder.TryAdd(filePath,
ChangeKind
.Delete);
176
private void NotifyChanges(Dictionary<string,
ChangeKind
> changes)
HotReload\HotReloadDotNetWatcher.cs (23)
245
if (changedFilesAccumulator.Any(change => change.Kind is
ChangeKind
.Add or
ChangeKind
.Delete))
360
var
changeKind = changedPath.Kind ==
ChangeKind
.Add ?
ChangeKind
.Update : changedPath.Kind;
579
if (changedFile.Kind is
ChangeKind
.Add)
862
if (item.Kind ==
ChangeKind
.Add)
869
lastUpdate ??= item with { Kind =
ChangeKind
.Update };
876
else if (item.Kind ==
ChangeKind
.Delete)
892
else if (item.Kind ==
ChangeKind
.Update)
913
Report(kind:
ChangeKind
.Add);
914
Report(kind:
ChangeKind
.Update);
915
Report(kind:
ChangeKind
.Delete);
917
void Report(
ChangeKind
kind)
926
string GetMessage(IReadOnlyList<ChangedFile> items,
ChangeKind
kind)
931
static string GetSingularMessage(
ChangeKind
kind)
934
ChangeKind
.Update => "File updated",
935
ChangeKind
.Add => "File added",
936
ChangeKind
.Delete => "File deleted",
940
static string GetPluralMessage(
ChangeKind
kind)
943
ChangeKind
.Update => "Files updated",
944
ChangeKind
.Add => "Files added",
945
ChangeKind
.Delete => "Files deleted",
UI\IReporter.cs (6)
244
public static readonly MessageDescriptor<(string,
ChangeKind
, string)> IgnoringChangeInHiddenDirectory = Create<(string,
ChangeKind
, string)>("Ignoring change in hidden directory '{0}': {1} '{2}'", Emoji.Watch, LogLevel.Trace);
245
public static readonly MessageDescriptor<(
ChangeKind
, string)> IgnoringChangeInOutputDirectory = Create<(
ChangeKind
, string)>("Ignoring change in output directory: {0} '{1}'", Emoji.Watch, LogLevel.Trace);
246
public static readonly MessageDescriptor<(string,
ChangeKind
, string, string, string)> IgnoringChangeInExcludedFile = Create<(string,
ChangeKind
, string, string, string)>("Ignoring change in excluded file '{0}': {1}. Path matches {2} glob '{3}' set in '{4}'.", Emoji.Watch, LogLevel.Trace);