public void InputEntered(string input)
        {
            var storedColors = ColorStore.StoreCurrentColors();

            currentControlLayout.Input(input);
            storedColors.Restore();
        }
        public bool KeyPressed(ConsoleKeyInfo key)
        {
            var  storedColors = ColorStore.StoreCurrentColors();
            bool result       = currentControlLayout.KeyPressed(key);

            storedColors.Restore();
            return(result);
        }
        protected override void DrawUnselected(Controls.UserControl ctrl)
        {
            base.DrawUnselected(ctrl);
            var storedColors = ColorStore.StoreCurrentColors();

            Console.BackgroundColor = Configuration.Global.GetValue <ConsoleColor>("term_color_control_unselected_background");
            Console.ForegroundColor = Configuration.Global.GetValue <ConsoleColor>("term_color_control_unselected_foreground");
            DrawControl(ctrl);
            storedColors.Restore();
        }
        public void RefreshDisplay(int x, int y, int w, int h)
        {
            var storedColors = ColorStore.StoreCurrentColors();

            writePosX   = x;
            writePosY   = y;
            writeWidth  = w;
            writeHeight = h;
            curX        = 0;
            curY        = 0;
            Align();
            Display();
            storedColors.Restore();
        }
Beispiel #5
0
        private void ModifyASCII(int ctrlIdx, int x, int y, char character, ConsoleColor text, ConsoleColor background)
        {
            int sidePad = 10;
            int pad     = (Width - 2) - (competition.FieldSize.X + (sidePad * 3));
            int baseX   = sidePad + ctrlIdx * (competition.FieldSize.X + pad);

            AlignToCoord(baseX + x, 8 + y);
            ColorStore prevColors = ColorStore.StoreCurrentColors();

            Console.BackgroundColor = background;
            Console.ForegroundColor = text;
            WriteCharRepeat(character, 1);
            prevColors.Restore();
        }