Giter Site home page Giter Site logo

Comments (4)

Hooch180 avatar Hooch180 commented on August 13, 2024

Simply set maxTics to 100 and in lambda in Progress just call Tick() with number as parameter.

from shellprogressbar.

rpawlaszek avatar rpawlaszek commented on August 13, 2024

Thanks @Hooch180, I did something like that, but with multiplying with a magic number, 100. I receive a more fine-grained numbers (as it is Progress<double>). Effectively, this is the same, but to me it is still a workaround. I have percentage in both cases, but cannot directly use one with the other.

from shellprogressbar.

0xced avatar 0xced commented on August 13, 2024

This scenario is addressed in #39 (Add AsProgress<T> method on IProgressBar). If this pull request gets merged, it will become trivial to update an IProgressBar with an existing IProgress<float> or IProgress<double> which reports the percentage completed by simply calling AsProgress<float>() on the progress bar, see IntegrationWithIProgressPercentageExample:

public Task Start(CancellationToken token)
{
using (var pbar = new ProgressBar(100, "A console progress that integrates with IProgress<float>"))
{
ProcessFiles(pbar.AsProgress<float>());
}
return Task.FromResult(1);
}
public static void ProcessFiles(IProgress<float> progress)
{

from shellprogressbar.

Mpdreamz avatar Mpdreamz commented on August 13, 2024

Closing this as @0xced's PR is now merged.

from shellprogressbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.