コード例 #1
0
        public StackWindow Pop()
        {
            _count--;
            StackWindow result = _stackWindows[_count];

            _stackWindows[_count] = null;
            return(result);
        }
コード例 #2
0
        public void Push(StackWindow stackWindow)
        {
            if (_count >= _maxCallDepth)
            {
                throw new BaseException(BaseException.Codes.CallStackOverflow, _maxCallDepth);
            }

            EnsureCapacity(_count);
            _stackWindows[_count] = stackWindow;
            _count++;
        }
コード例 #3
0
 private void EnsureCapacity(int requiredCapacity)
 {
     if (_stackWindows.Length <= requiredCapacity)
     {
         StackWindow[] newStackWindows = new StackWindow[Math.Max(_stackWindows.Length, 1) * 2];
         for (int index = 0; index < _stackWindows.Length; index++)
         {
             newStackWindows[index] = _stackWindows[index];
         }
         _stackWindows = newStackWindows;
     }
 }