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)
242
if (changedFilesAccumulator.Any(change => change.Kind is
ChangeKind
.Add or
ChangeKind
.Delete))
346
var
changeKind = changedPath.Kind ==
ChangeKind
.Add ?
ChangeKind
.Update : changedPath.Kind;
566
if (changedFile.Kind is
ChangeKind
.Add)
849
if (item.Kind ==
ChangeKind
.Add)
856
lastUpdate ??= item with { Kind =
ChangeKind
.Update };
863
else if (item.Kind ==
ChangeKind
.Delete)
879
else if (item.Kind ==
ChangeKind
.Update)
900
Report(kind:
ChangeKind
.Add);
901
Report(kind:
ChangeKind
.Update);
902
Report(kind:
ChangeKind
.Delete);
904
void Report(
ChangeKind
kind)
913
string GetMessage(IReadOnlyList<ChangedFile> items,
ChangeKind
kind)
918
static string GetSingularMessage(
ChangeKind
kind)
921
ChangeKind
.Update => "File updated",
922
ChangeKind
.Add => "File added",
923
ChangeKind
.Delete => "File deleted",
927
static string GetPluralMessage(
ChangeKind
kind)
930
ChangeKind
.Update => "Files updated",
931
ChangeKind
.Add => "Files added",
932
ChangeKind
.Delete => "Files deleted",
UI\IReporter.cs (6)
242
public static readonly MessageDescriptor<(string,
ChangeKind
, string)> IgnoringChangeInHiddenDirectory = Create<(string,
ChangeKind
, string)>("Ignoring change in hidden directory '{0}': {1} '{2}'", Emoji.Watch, LogLevel.Trace);
243
public static readonly MessageDescriptor<(
ChangeKind
, string)> IgnoringChangeInOutputDirectory = Create<(
ChangeKind
, string)>("Ignoring change in output directory: {0} '{1}'", Emoji.Watch, LogLevel.Trace);
244
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);