Beispiel #1
0
        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;
                    }
                }
            }
        }
Beispiel #2
0
        public T Peek()
        {
            if (Count == 0)
            {
                throw new Exception("No item to dequeue.");
            }
            T item = UnderlyingList.First();

            return(item);
        }
Beispiel #3
0
        public T Peek()
        {
            if (UnderlyingList.LongCount == 0)
            {
                throw new Exception("No item to dequeue.");
            }
            T item = UnderlyingList.GetAtIndex(UnderlyingList.LongCount - 1);

            return(item);
        }
Beispiel #4
0
        public T Dequeue()
        {
            if (!UnderlyingList.Any())
            {
                throw new Exception("Nothing to dequeue.");
            }
            T item = UnderlyingList.First();

            UnderlyingList.RemoveAtIndex(0);
            return(item);
        }
Beispiel #5
0
 public void Enqueue(T item)
 {
     UnderlyingList.Add(item);
 }
Beispiel #6
0
 public void Push(T item)
 {
     UnderlyingList.Add(item);
 }