Пример #1
0
 public static IEnumerable <TNode> GetNodes <TNode>(this IBidirListNode <TNode> first, TNode last, Direction dir) where TNode : class, IBidirListNode <TNode>
 {
     for (var node = (TNode)first; node != last.GetNext(dir); node = node.GetNext(dir))
     {
         yield return(node);
     }
 }
Пример #2
0
        public static TNode GetNext <TNode>(this IBidirListNode <TNode> node, Direction dir, Func <TNode, TNode, bool> filter) where TNode : class, IBidirListNode <TNode>
        {
            var cur = (TNode)node;

            do
            {
                cur = cur.GetNext(dir);
            }while (cur != node.List.GetEnd(dir) && !filter((TNode)node, cur));
            return(cur);
        }
Пример #3
0
 public static TNode GetNext <TNode>(this IBidirListNode <TNode> node, Func <TNode, TNode, bool> filter) where TNode : class, IBidirListNode <TNode>
 {
     return(GetNext(node, Direction.LeftToRight, filter));
 }
Пример #4
0
 public static IEnumerable <TNode> GetNodes <TNode>(this IBidirListNode <TNode> first, Direction dir) where TNode : class, IBidirListNode <TNode>
 {
     return(GetNodes(first, first.List.GetLast(dir), dir));
 }
Пример #5
0
 public static IEnumerable <TNode> GetNodes <TNode>(this IBidirListNode <TNode> first, TNode last) where TNode : class, IBidirListNode <TNode>
 {
     return(GetNodes(first, last, Direction.LeftToRight));
 }