C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
InitiateSafeShutdown ( ) : void
InitiateSafeShutdown ( object sender, EventArgs e ) : void
ShutdownHandler ( ) : System

Описание методов

Initialize() публичный статический Метод

Initializes the shutdown handler. This is recommended to put in main loop of the program, but it is not critical.
public static Initialize ( ) : void
Результат void

TryRegisterCallback() публичный статический Метод

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.
Результат bool