Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Spawn child progress as indeterminate progress bar #99

Closed
diegosps opened this issue Jun 6, 2022 · 0 comments
Closed

[Feature] Spawn child progress as indeterminate progress bar #99

diegosps opened this issue Jun 6, 2022 · 0 comments

Comments

@diegosps
Copy link
Contributor

diegosps commented Jun 6, 2022

I have this use case where a process with multiple steps is displayed using the nested progress bar.
However some of these steps are not deterministic.
Currently, there is no way to use the IndeterminateProgressBar as a child progress.

I made a simple PR #98 that enables the adds the SpawnIndeterminate function in ProgressBarBase
Example:

using (var pbar = new ProgressBar(totalChildren, "main progressbar", options))
	{
		for (int i = 1; i <= totalChildren; i++)
		{
			pbar.Message = $"Start {i} of {totalChildren}: main progressbar";
			using (var child = pbar.SpawnIndeterminate("child action " + i, childOptions))
			{
				Thread.Sleep(1000 * random.Next(5, 15));
				child.Finished();
			}
			pbar.Tick();
		}
	}
@diegosps diegosps closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant