private void FindSelectedNodes() { SyntaxList <TNode> .Enumerator en = UnderlyingList.GetEnumerator(); if (en.MoveNext()) { int i = 0; while (Span.Start >= en.Current.FullSpan.End && en.MoveNext()) { i++; } if (Span.Start >= en.Current.FullSpan.Start && Span.Start <= en.Current.Span.Start) { int j = i; while (Span.End > en.Current.FullSpan.End && en.MoveNext()) { j++; } if (Span.End >= en.Current.Span.End && Span.End <= en.Current.FullSpan.End) { _firstIndex = i; _lastIndex = j; } } } }
public T Peek() { if (Count == 0) { throw new Exception("No item to dequeue."); } T item = UnderlyingList.First(); return(item); }
public T Peek() { if (UnderlyingList.LongCount == 0) { throw new Exception("No item to dequeue."); } T item = UnderlyingList.GetAtIndex(UnderlyingList.LongCount - 1); return(item); }
public T Dequeue() { if (!UnderlyingList.Any()) { throw new Exception("Nothing to dequeue."); } T item = UnderlyingList.First(); UnderlyingList.RemoveAtIndex(0); return(item); }
public void Enqueue(T item) { UnderlyingList.Add(item); }
public void Push(T item) { UnderlyingList.Add(item); }