/// <inheritdoc/>
        public override IRenderable Render(RenderContext context, ProgressTask task, TimeSpan deltaTime)
        {
            if (task.Speed == null)
            {
                return(new Text("?/s"));
            }

            var size = new FileSize(task.Speed.Value);

            return(new Markup(string.Format("{0}/s", size.ToString(suffix: true, Culture))));
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override IRenderable Render(RenderContext context, ProgressTask task, TimeSpan deltaTime)
        {
            var total = new FileSize(task.MaxValue);

            if (task.IsFinished)
            {
                return(new Markup(string.Format(
                                      "[green]{0} {1}[/]",
                                      total.Format(Culture),
                                      total.Suffix)));
            }
            else
            {
                var downloaded = new FileSize(task.Value, total.Unit);

                return(new Markup(string.Format(
                                      "{0}[grey]/[/]{1} [grey]{2}[/]",
                                      downloaded.Format(Culture),
                                      total.Format(Culture),
                                      total.Suffix)));
            }
        }