Пример #1
0
        public CalcModernBuffer(int width, int height, int wWidth, int wHeight) : base(width, height, wWidth, wHeight)
        {
            OpProvider = new LastOp();

            RowInputData       = 2;
            RowBufferOperation = 1;

            _colInputDataInitPosition = 20;

            EmptySpaceCalcUI    = new string(' ', 19);
            UndelineSpaceCalcUI = new string('_', 19);

            _inputDataTemplateUI = string.Format("|__________________0|{0}", "\n");

            _keyboardTemplateUI = string.Format(
                "|  7    8    9   /  |{0}"
                + "|  4    5    6   *  |{0}"
                + "|  1    2    3   -  |{0}"
                + "|  0    ,    e   +  |{0}", "\n");

            _calcTemplateUI = string.Format(
                " {2} {0}"
                + "|{1}|{0}"
                + "{3}"
                + "|-------------------|{0}"
                + "{4}"
                + " -------------------{0}{0}{0}{0}"
                + "Press 'c' to clear the calc or 'q' for exit to the main menu... {0}", "\n", EmptySpaceCalcUI, UndelineSpaceCalcUI, _inputDataTemplateUI, _keyboardTemplateUI);

            Console.CursorVisible = false;
            Console.SetWindowSize(_width, _height);
            Console.SetBufferSize(_width, _height);
        }
Пример #2
0
        /// <summary>
        /// Clear the buffer and reset all depended value to value by default
        /// </summary>
        public virtual void ClearBufferAndShowInitScreen()
        {
            Clear();
            WriteTextDividedByNewLine(_calcTemplateUI);
            Print();

            OpProvider = new LastOp();
            Console.SetCursorPosition(_colInputDataInitPosition, RowInputData);
        }