IShutdown |
public interface IShutdownService
The IShutdownService type exposes the following members.
Name | Description | |
---|---|---|
CurrentReasonPreventingShutdown | Gets the current reason that prevents shutdown. If there isn't any reason, returns null. If there are multiple reasons, only one of them is returned. | |
DelayedShutdownToken | Gets a cancellation token that gets signalled a couple of seconds after the ShutdownToken. This cancellation token may be used to stop background calculations that should run for a limited time after the application is closed (e.g. saving state in caches - work that should better run even though we're shutting down, but shouldn't take too long either) | |
IsApplicationClosing | Gets a value indicating whether the application is closing. | |
ShutdownToken | Gets a cancellation token that gets signalled when the application is shutting down. This cancellation token may be used to stop background calculations. |
Name | Description | |
---|---|---|
AddBackgroundTask | Adds a background task on which the application should wait on shutdown. Use this method for tasks that asynchronously write state to disk and should not be interrupted by the applicaiton closing down. | |
OnClosing | Execute the closing procedure, and maybe prevent the workbench from closing by setting Cancel to true in the event args. | |
PreventShutdown | Prevents shutdown with the following reason. Dispose the returned value to allow shutdown again. | |
Shutdown | Attemps to close the IDE. | |
SignalShutdownToken |
Name | Description | |
---|---|---|
Closed | Occurs when the project was already closed and the rest of the shutdown procedure starts to happen. This should be implemented as weak event in order to prevent garbage collection of item that subscribe to this event. |