Beispiel #1
0
        // Move up one line in the history.
        private void MoveUp()
        {
            if (_history == null)
            {
                Console.Beep();
                return;
            }

            if (_historyPosn == -1)
            {
                if (_history.Count > 0)
                {
                    _historySave = new string(_buffer, 0, _length);
                    _historyPosn = 0;
                    SetCurrent(_history.GetItemAt(_historyPosn));
                }
            }
            else if ((_historyPosn + 1) < _history.Count)
            {
                ++_historyPosn;
                SetCurrent(_history.GetItemAt(_historyPosn));
            }
            else
            {
                Console.Beep();
            }
        }