public void Write()
        {
            if (!Environment.UserInteractive)
            {
                return;
            }

            var consoleWidth  = Console.BufferWidth - 2;
            var length        = Maximum - Minimum;
            var segmentLength = ((double)consoleWidth / length);
            var barLength     = (int)Math.Ceiling(Value * segmentLength);

            if (_lastBarLength == barLength)
            {
                return;
            }

            _lastBarLength = barLength;

            var fillerLength = consoleWidth - barLength;

            Cli.Write(
                "\r ~Cyan~{0}~R~~Gray~{1}~R~",
                new string('█', barLength),
                new string('█', fillerLength));
        }
Ejemplo n.º 2
0
 public void Update(Action action)
 {
     Cli.Write("\r");
     action();
     DrawPrompt();
 }
Ejemplo n.º 3
0
 public void DrawPrompt()
 {
     Cli.Write("~Cyan~#~R~ ");
 }