public void MergeConfiguration() { var lines = _IntegrityConfigurationFile.ReadAllLinesOrDefault(); if (lines.IsNullOrEmpty()) { return; } foreach (var line in lines) { if (line.IsNullOrWhiteSpace()) { continue; } var rootDirectory = new DirectoryInfo(line); if (rootDirectory.NotExists()) { continue; } var checker = FolderIntegrityChecker.Create(rootDirectory); lock (this._integrityCheckers) this._integrityCheckers.Add(checker); checker.Enabled = true; } }
public void AcceptChange(FolderIntegrityChecker checker, FileInfo file) => checker.UpdateFile(file);
public static DgvEntry FromFailedChecksum(FolderIntegrityChecker checker, FileInfo file, string old, string current) => new DgvEntry( checker, file, old, current);
public static DgvEntry FromException(FolderIntegrityChecker checker, FileInfo file, string old, Exception exception) => new DgvEntry( checker, file, old, exception);
private DgvEntry(FolderIntegrityChecker checker, FileInfo file, string oldChecksum, Exception exception) : this(checker, file) { this._exception = exception; this.OldChecksum = oldChecksum; this.Image = Resources._16x16_Error; }
private DgvEntry(FolderIntegrityChecker checker, FileInfo file, string oldChecksum, string currentChecksum) : this(checker, file) { this.Checksum = currentChecksum; this.OldChecksum = oldChecksum; this.Image = Resources._16x16_Warning; }
private DgvEntry(FolderIntegrityChecker checker, FileInfo file) { this._file = file; this.Checker = checker; }
internal void MarkFileException(FolderIntegrityChecker checker, FileInfo file, string oldChecksum, Exception exception) => this.SafelyInvoke(() => this._AddEntry(DgvEntry.FromException(checker, file, oldChecksum, exception)));
internal void MarkFileChecksumFailed(FolderIntegrityChecker checker, FileInfo file, string oldChecksum, string newChecksum) => this.SafelyInvoke(() => this._AddEntry(DgvEntry.FromFailedChecksum(checker, file, oldChecksum, newChecksum)));