private void Remove(IProcess aProcess, ProcessGroupNode aGroupNode) { aGroupNode.UnGroup(aProcess); if (aGroupNode.IsDeleted) { _groups.Remove(aGroupNode); } }
private ProcessGroupNode InitializeGroupFor(ProcessNode aNode) { var group = new ProcessGroupNode(aNode); _groups.Add(group); AddNodeInLexigographycalOrder(group); return(group); }
private int FindIndexOfNodeThatShouldPrecede(ProcessGroupNode aNodeGroup) { Func <Node, bool> textPrecedesNodeText = node => aNodeGroup.Text.CompareTo(node.Text) > 0; if (!Nodes.Any(textPrecedesNodeText)) { return(-1); } return(Nodes.Last(textPrecedesNodeText).Index); }
private void AddNodeInLexigographycalOrder(ProcessGroupNode aNodeGroup) { var index = FindIndexOfNodeThatShouldPrecede(aNodeGroup); Nodes.Insert(index + 1, aNodeGroup); }