Example #1
0
        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);
        }
Example #2
0
 public void AddChild(IConflictTreeNode node, string name)
 {
     if (Children == null)
     {
         Children = new List <(string name, IConflictTreeNode node)>();
     }
     Children.Add((name, node));
 }
Example #3
0
        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);
        }
Example #4
0
#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);
        }
Example #5
0
 public ConflictModelFactory(IToolConflictItem toolConflictItem, IContextualResourceModel resourceModel, IConflictTreeNode conflict)
 {
     _resourceModel = resourceModel;
     CreateModelItem(toolConflictItem, conflict);
 }