/// <summary> Initializes comparison from any two entries. </summary> /// <param name="left">Left entry.</param> /// <param name="right">Right entry.</param> /// <returns>true if comparison of two entries by this trait can be performed; false otherwise.</returns> protected override bool InitFromEntries(Entry left, Entry right) { LeftSize = left.Size; RightSize = right.Size; return true; }
/// <summary> Initializes comparison from any two entries. </summary> /// <param name="left">Left entry.</param> /// <param name="right">Right entry.</param> /// <returns>true if comparison of two entries by this trait can be performed; false otherwise.</returns> protected virtual bool InitFromEntries(Entry left, Entry right) { return false; }
/// <summary> Initializes comparison from any two entries. </summary> /// <param name="left">Left entry.</param> /// <param name="right">Right entry.</param> /// <returns>true if comparison of two entries by this trait can be performed; false otherwise.</returns> protected override bool InitFromEntries(Entry left, Entry right) { LeftParent = left.ParentFolder; RightParent = right.ParentFolder; return true; }
/// <summary> Initializes comparison from any two entries. </summary> /// <param name="left">Left entry.</param> /// <param name="right">Right entry.</param> /// <returns>true if comparison of two entries by this trait can be performed; false otherwise.</returns> protected override bool InitFromEntries(Entry left, Entry right) { LeftLastModified = left.LastModified; RightLastModified = right.LastModified; return true; }
/// <summary> Initializes comparison from any two entries. </summary> /// <param name="left">Left entry.</param> /// <param name="right">Right entry.</param> /// <returns>true if comparison of two entries by this trait can be performed; false otherwise.</returns> protected override bool InitFromEntries(Entry left, Entry right) { LeftEntryType = Entry.Type(left); RightEntryType = Entry.Type(right); return true; }
/// <summary> Finds proeprty differences between entries. </summary> /// <param name="left">'Left' entry.</param> /// <param name="right">'Right' entry.</param> public static IEnumerable<EntryTraitDifference> PropertiesDiff(Entry left, Entry right) { Contract.Requires(left != null); Contract.Requires(right != null); return Comparisons .Select(cmpType => (EntryTraitDifference)Activator.CreateInstance(cmpType, left, right)) .Where(cmp => cmp != null && cmp.ComparisonExists && cmp.DifferenceExists); }
internal void Add(Entry entry) { Contract.Requires(entry != null); _contents.Add(entry); }