C# Class Catel.Services.PleaseWaitService

ファイルを表示 Open project: Catel/Catel

Public Methods

Method Description
Hide ( ) : void

Hides this please wait window.

PleaseWaitService ( ILanguageService languageService ) : System

Initializes a new instance of the PleaseWaitService class.

Pop ( ) : void

Decreases the number of clients that show the please wait window. The implementing class is responsible for holding a counter internally which a call to this method will decrease. As long as the internal counter is not zero (0), the please wait window will stay visible. To increase the counter, make a call to Pop. A call to Show(string) or one of its overloads will not increase the internal counter. A call to Hide will reset the internal counter to zero (0) and thus hide the window.

Push ( string status = "" ) : void

Increases the number of clients that show the please wait window. The implementing class is responsible for holding a counter internally which a call to this method will increase. As long as the internal counter is not zero (0), the please wait window will stay visible. To decrease the counter, make a call to Pop. A call to Show(string) or one of its overloads will not increase the internal counter. A call to Hide will reset the internal counter to zero (0) and thus hide the window.

Show ( PleaseWaitWorkDelegate workDelegate, string status = "" ) : void

Shows the please wait window with the specified status text and executes the work delegate (in a background thread). When the work is finished, the please wait window will be automatically closed.

Show ( string status = "" ) : void

Shows the please wait window with the specified status text.

When this method is used, the M:Catel.Services.IPleaseWaitService.Hide method must be called to hide the window again.

UpdateStatus ( int currentItem, int totalItems, string statusFormat = "" ) : void

Updates the status and shows a progress bar with the specified status text. The percentage will be automatically calculated. The busy indicator will automatically hide when the totalItems is larger than currentItem. When providing the statusFormat, it is possible to use {0} (represents current item) and {1} (represents total items).

UpdateStatus ( string status ) : void

Updates the status text.

Private Methods

Method Description
HideBusyIndicator ( ) : void
InitializeBusyIndicator ( ) : void
SetStatus ( string status ) : void
ShowBusyIndicator ( bool indeterminate ) : void

Method Details

Hide() public method

Hides this please wait window.
public Hide ( ) : void
return void

PleaseWaitService() public method

Initializes a new instance of the PleaseWaitService class.
public PleaseWaitService ( ILanguageService languageService ) : System
languageService ILanguageService The language service.
return System

Pop() public method

Decreases the number of clients that show the please wait window. The implementing class is responsible for holding a counter internally which a call to this method will decrease. As long as the internal counter is not zero (0), the please wait window will stay visible. To increase the counter, make a call to Pop. A call to Show(string) or one of its overloads will not increase the internal counter. A call to Hide will reset the internal counter to zero (0) and thus hide the window.
public Pop ( ) : void
return void

Push() public method

Increases the number of clients that show the please wait window. The implementing class is responsible for holding a counter internally which a call to this method will increase. As long as the internal counter is not zero (0), the please wait window will stay visible. To decrease the counter, make a call to Pop. A call to Show(string) or one of its overloads will not increase the internal counter. A call to Hide will reset the internal counter to zero (0) and thus hide the window.
public Push ( string status = "" ) : void
status string The status to change the text to.
return void

Show() public method

Shows the please wait window with the specified status text and executes the work delegate (in a background thread). When the work is finished, the please wait window will be automatically closed.
public Show ( PleaseWaitWorkDelegate workDelegate, string status = "" ) : void
workDelegate PleaseWaitWorkDelegate The work delegate.
status string The status. When the string is null or empty, the default please wait text will be used.
return void

Show() public method

Shows the please wait window with the specified status text.
When this method is used, the M:Catel.Services.IPleaseWaitService.Hide method must be called to hide the window again.
public Show ( string status = "" ) : void
status string The status. When the string is null or empty, the default please wait text will be used.
return void

UpdateStatus() public method

Updates the status and shows a progress bar with the specified status text. The percentage will be automatically calculated. The busy indicator will automatically hide when the totalItems is larger than currentItem. When providing the statusFormat, it is possible to use {0} (represents current item) and {1} (represents total items).
The is smaller than zero. The is null.
public UpdateStatus ( int currentItem, int totalItems, string statusFormat = "" ) : void
currentItem int The current item.
totalItems int The total items.
statusFormat string The status format. Can be empty, but not null.
return void

UpdateStatus() public method

Updates the status text.
public UpdateStatus ( string status ) : void
status string The status. When the string is null or empty, the default please wait text will be used.
return void