Method | Description | |
---|---|---|
CliProgressBar ( ConsoleString initialMessage = null, int width = null ) : System |
Creates a new progress bar given a width
|
|
CliProgressBar ( string initialMessage, int width = null ) : System |
Creates a new progress bar given a width
|
|
Render ( ) : void |
Renders the entire progress bar
|
|
RenderAndPollDeterminate ( System.Action pollAction, System.TimeSpan pollingInterval ) : void |
Renders the progress bar and automatically updates it on a polling interval. The method blocks until the progress reaches 1 or your poll action throws an OperationCancelledException, whichever comes first. It is expected that you will update the progress via the poll action. You can also update the message during the poll action.
|
|
RenderAndPollIndeterminate ( Func |
Renders the progress bar and shows an indeterminate progress animation until the operation completes
|
|
RenderUntilIndeterminate ( System.Action workAction ) : void |
Renders the progress bar and shows an indeterminate progress animation. Simultaneously, the work action is started. The bar will animate as long as the work action is running.
|
|
RenderUntilIndeterminate ( Task workTask ) : void |
Renders the progress bar and shows an indeterminate progress animation until the Task completes. This method will not start the task so it must be started somewhere else.
|
|
Update ( ) : void |
Renders the middle portion of the progress bar that contains the message and progress fill. You must have called Render() ahead of time for this to make sense.
|
|
Wipe ( ) : void |
Clears the progress bar from the console and restores the console to the position it was in before drawing the progress bar
|
Method | Description | |
---|---|---|
DrawBorder ( ) : void | ||
DrawHorizontalLine ( ) : void |
public CliProgressBar ( ConsoleString initialMessage = null, int width = null ) : System | ||
initialMessage | ConsoleString | an initial message to display in the progress bar |
width | int | the width to use or null to use the default width which is one third of the console buffer width |
return | System |
public CliProgressBar ( string initialMessage, int width = null ) : System | ||
initialMessage | string | an initial message to display in the progress bar |
width | int | the width to use or null to use the default width which is one third of the console buffer width |
return | System |
public RenderAndPollDeterminate ( System.Action pollAction, System.TimeSpan pollingInterval ) : void | ||
pollAction | System.Action | An action to run on each polling interval |
pollingInterval | System.TimeSpan | The polling interval |
return | void |
public RenderAndPollIndeterminate ( Func |
||
heartbeat | Func |
a function that should return true as long as you want to continue to block. If you return false then this method will return. |
pollingInterval | System.TimeSpan | How fast you want the progress bar to call your heartbeat function |
return | void |
public RenderUntilIndeterminate ( System.Action workAction ) : void | ||
workAction | System.Action | |
return | void |
public RenderUntilIndeterminate ( Task workTask ) : void | ||
workTask | Task | the task to wait for. This method will not start the task so it must be started somewhere else. |
return | void |