private bool ChildrenEquals(IConflictTreeNode other) { if (Children == null && other.Children == null) { return(true); } if ((Children == null && other.Children != null) || (Children != null && other.Children == null)) { return(false); } if (Children.Count != other.Children.Count) { return(false); } var equals = true; for (int i = 0; i < Children.Count; i++) { equals &= Equals(Children[i].node, other.Children[i].node); equals &= Equals(Children[i].uniqueId, other.Children[i].uniqueId); if (!equals) { break; } } return(equals); }
public void AddChild(IConflictTreeNode node, string name) { if (Children == null) { Children = new List <(string name, IConflictTreeNode node)>(); } Children.Add((name, node)); }
public bool Equals(IConflictTreeNode other) { if (other == null) { return(false); } var equals = true; equals &= other.UniqueId == UniqueId; equals &= other.Activity.Equals(Activity); equals &= ChildrenEquals(other); return(equals); }
#pragma warning disable S1541 // Methods and properties should not be too complex public bool Equals(IConflictTreeNode other) #pragma warning restore S1541 // Methods and properties should not be too complex { if (other == null) { return(false); } var equals = true; equals &= other.UniqueId == UniqueId; equals &= other.Activity.Equals(Activity); equals &= (other.Children != null || Children == null); equals &= (other.Children == null || Children != null); equals &= (Children == null || Children.SequenceEqual(other.Children ?? new List <(string uniqueId, IConflictTreeNode node)>())); return(equals); }
public ConflictModelFactory(IToolConflictItem toolConflictItem, IContextualResourceModel resourceModel, IConflictTreeNode conflict) { _resourceModel = resourceModel; CreateModelItem(toolConflictItem, conflict); }