You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have this code that I use to show the progress of a task and I want to makeit use the progress bar of Spectre:
public static IEnumerable ProgressBar(IEnumerable values)
{
int i = 0;
foreach (var item in values)
{
yield return item;
Console.Write($"{i++}/{values.Count()}");
}
Console.WriteLine(" Done");
}
EXAMPLE:
var list = new List(){1,2,3,4,5,6,7,8};
foreach(var item in ProgressBar(list)){
...
}
Describe the solution you'd like
I want to be able to iterate trough a list/IEnumerable and get progress of that iteration.
Describe alternatives you've considered
Tried to use the AnsiConsole.Progress().Start but it creates an Func, making the yeld return not possible.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I have this code that I use to show the progress of a task and I want to makeit use the progress bar of Spectre:
public static IEnumerable ProgressBar(IEnumerable values)
{
int i = 0;
foreach (var item in values)
{
yield return item;
Console.Write($"{i++}/{values.Count()}");
}
Console.WriteLine(" Done");
}
EXAMPLE:
var list = new List(){1,2,3,4,5,6,7,8};
foreach(var item in ProgressBar(list)){
...
}
Describe the solution you'd like
I want to be able to iterate trough a list/IEnumerable and get progress of that iteration.
Describe alternatives you've considered
Tried to use the AnsiConsole.Progress().Start but it creates an Func, making the yeld return not possible.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: