void GenerateChangeImage(IReadOnlyCollection <IAbsoluteFilePath> workingPathFiles, IOrderedEnumerable <FileObjectMapping> packageFileMappings, Package package) { var changeDictionary = new Dictionary <string, string>(); foreach (var file in workingPathFiles) { MakeChecksum(package, file, changeDictionary); } foreach (var f in changeDictionary) { EnumerateRemovals(f.Key, packageFileMappings); } foreach (var file in packageFileMappings) { EnumerateChanges(file, changeDictionary, package); } foreach (var file in ChangedCase.Where(file => Remove.Contains(file.Key)).ToArray()) { Remove.Remove(file.Key); } }
void ProcessFoundByChecksum(FileObjectMapping file, string found) { if (found.Equals(file.FilePath, StringComparison.OrdinalIgnoreCase)) { ChangedCase.Add(found, file.FilePath); } else if (Copy.ContainsKey(found)) { Copy[found].Add(file.FilePath); } else { Copy.Add(found, new List <string> { file.FilePath }); } }
public void FireChangedCase(object sender, MultiCaseEventArgs e) { ChangedCase?.Invoke(sender, e); }
public bool HasChanges(bool withRemoval) => (withRemoval && Remove.Any()) || Update.Any() || New.Any() || Copy.Any() || ChangedCase.Any();