コード例 #1
0
 private void Remove(IProcess aProcess, ProcessGroupNode aGroupNode)
 {
     aGroupNode.UnGroup(aProcess);
     if (aGroupNode.IsDeleted)
     {
         _groups.Remove(aGroupNode);
     }
 }
コード例 #2
0
        private ProcessGroupNode InitializeGroupFor(ProcessNode aNode)
        {
            var group = new ProcessGroupNode(aNode);

            _groups.Add(group);
            AddNodeInLexigographycalOrder(group);

            return(group);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private void AddNodeInLexigographycalOrder(ProcessGroupNode aNodeGroup)
        {
            var index = FindIndexOfNodeThatShouldPrecede(aNodeGroup);

            Nodes.Insert(index + 1, aNodeGroup);
        }