Пример #1
0
 protected override void OnRender(ControlRenderInfo cri)
 {
     System.Console.BackgroundColor = Selected ? SelectedBackColor : BackColor;
     System.Console.ForegroundColor = Selected ? SelectedForeColor : ForeColor;
     System.Console.CursorLeft      = ParentMenu.Width / 2 - Text.Length / 2;
     System.Console.Write(Text);
     System.Console.BackgroundColor = ParentMenu.BackColor;
     System.Console.ForegroundColor = ParentMenu.ForeColor;
 }
Пример #2
0
        protected override void OnRender(ControlRenderInfo cri)
        {
            string finalText = (new string(' ', Padding) + $"[{GetCheckedChar()}] {Label}").PadRight(cri.Width);

            System.Console.BackgroundColor = Selected ? SelectedBackColor : BackColor;
            System.Console.ForegroundColor = Selected ? SelectedForeColor : ForeColor;
            System.Console.Write(finalText);
            System.Console.BackgroundColor = ParentMenu.BackColor;
            System.Console.ForegroundColor = ParentMenu.ForeColor;
        }
Пример #3
0
        protected override void OnRender(ControlRenderInfo cri)
        {
            System.Console.BackgroundColor = Selected ? SelectedBackColor : BackColor;
            System.Console.ForegroundColor = Selected ? SelectedForeColor : ForeColor;

            if (TextAlignement == TextAlignement.Left)
            {
                System.Console.CursorLeft = Padding;
            }
            if (TextAlignement == TextAlignement.Middle)
            {
                System.Console.CursorLeft = ParentMenu.Width / 2 - Text.Length / 2;
            }
            else if (TextAlignement == TextAlignement.Right)
            {
                System.Console.CursorLeft = ParentMenu.Width - Text.Length - Padding;
            }

            System.Console.Write(Text);
            System.Console.BackgroundColor = ParentMenu.BackColor;
            System.Console.ForegroundColor = ParentMenu.ForeColor;
        }