C# Class GSF.Threading.ShutdownHandler

This class will monitor the state to the application and raise events when it detects that the application is about to shutdown.
Afficher le fichier Open project: GridProtectionAlliance/gsf Class Usage Examples

Méthodes publiques

Méthode Description
Initialize ( ) : void

Initializes the shutdown handler. This is recommended to put in main loop of the program, but it is not critical.

TryRegisterCallback ( System.Action callback, ShutdownHandlerOrder shutdownOrder = ShutdownHandlerOrder.Default ) : bool

Attempts Registers a callback that will be called when the application is shutdown.

Private Methods

Méthode Description
InitiateSafeShutdown ( ) : void
InitiateSafeShutdown ( object sender, EventArgs e ) : void
ShutdownHandler ( ) : System

Method Details

Initialize() public static méthode

Initializes the shutdown handler. This is recommended to put in main loop of the program, but it is not critical.
public static Initialize ( ) : void
Résultat void

TryRegisterCallback() public static méthode

Attempts Registers a callback that will be called when the application is shutdown.
public static TryRegisterCallback ( System.Action callback, ShutdownHandlerOrder shutdownOrder = ShutdownHandlerOrder.Default ) : bool
callback System.Action the callback when the shutdown occurs
shutdownOrder ShutdownHandlerOrder the order that the callback will occur.
Résultat bool