Beispiel #1
0
        public INode FindOldestItemOnBranch(IEnumerable <INode> nodes)
        {
            Node[] nodesArray = nodes.Select(Unwrap).ToArray();

            // Make sure these nodes are from the same branch.
            IBranch sourceBranch = nodesArray.Select(node => _containedInBranch[node]).Distinct().SingleOrDefault();

            if (sourceBranch == null)
            {
                return(null);
            }

            OrderedSet <Node> set = _branches[sourceBranch];

            INode oldest = set.PickFirst(nodesArray);

            return(oldest);
        }