public DiffEntry AddEntry(string name, DiffEntryType diffEntryType, string details = null) { var entry = new DiffEntry {Name = name, Type = diffEntryType, Details = details}; Entries.Add(entry); return entry; }
/// <summary> /// Initializes a new instance of the DiffEntry class. /// </summary> /// <param name="type">DiffEntry type.</param> /// <param name="filename">File name.</param> /// <param name="sourceHash">Old file version hash.</param> /// <param name="targetHash">New file version hash.</param> public DiffEntry(DiffEntryType type, string filename, string sourceHash = null, string targetHash = null) { this.Type = type; this.Filename = filename; this.SourceHash = sourceHash; this.TargetHash = targetHash; }
static void addEntry(List <DiffEntry> diffList, DiffEntryType type, char?value = null) { var lastDiff = diffList.Count > 0 ? diffList[diffList.Count - 1] : null; if (lastDiff != null && lastDiff.EntryType == type) { if (type == DiffEntryType.Add) { if (lastDiff.Value.Length < 256) { lastDiff.Value = value.ToString() + lastDiff.Value; return; } } else { if (lastDiff.Count < 256) { lastDiff.Count++; return; } } } diffList.Add(new DiffEntry { EntryType = type, Count = 1, Value = value == null ? null : value.ToString() }); }
internal DiffEntry() { _entryType = DiffEntryType.Equal; _count = 1; }
internal DiffEntry(DiffEntryType entryType, T obj) { _entryType = entryType; _obj = obj; }