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)); }
public void Update(Action action) { Cli.Write("\r"); action(); DrawPrompt(); }
public void DrawPrompt() { Cli.Write("~Cyan~#~R~ "); }