C# 클래스 PowerArgs.Cli.CliProgressBar

A utility that lets you display a progress bar on the console
파일 보기 프로젝트 열기: adamabdelhamed/PowerArgs

공개 메소드들

메소드 설명
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 heartbeat, System.TimeSpan pollingInterval ) : void

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

비공개 메소드들

메소드 설명
DrawBorder ( ) : void
DrawHorizontalLine ( ) : void

메소드 상세

CliProgressBar() 공개 메소드

Creates a new progress bar given a width
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
리턴 System

CliProgressBar() 공개 메소드

Creates a new progress bar given a width
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
리턴 System

Render() 공개 메소드

Renders the entire progress bar
public Render ( ) : void
리턴 void

RenderAndPollDeterminate() 공개 메소드

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.
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
리턴 void

RenderAndPollIndeterminate() 공개 메소드

Renders the progress bar and shows an indeterminate progress animation until the operation completes
public RenderAndPollIndeterminate ( Func heartbeat, System.TimeSpan pollingInterval ) : void
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
리턴 void

RenderUntilIndeterminate() 공개 메소드

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.
public RenderUntilIndeterminate ( System.Action workAction ) : void
workAction System.Action
리턴 void

RenderUntilIndeterminate() 공개 메소드

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.
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.
리턴 void

Update() 공개 메소드

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.
public Update ( ) : void
리턴 void

Wipe() 공개 메소드

Clears the progress bar from the console and restores the console to the position it was in before drawing the progress bar
public Wipe ( ) : void
리턴 void