Click or drag to resize

IShutdownService Interface

Service that is responsible for managing the IDE shutdown. Furthermore it can intercept the shutdown if shutdown is not currently possible.

Namespace: Altaxo.Main.Services
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public interface IShutdownService

The IShutdownService type exposes the following members.

Properties
 NameDescription
Public propertyCurrentReasonPreventingShutdown 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.
Public propertyDelayedShutdownToken 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)
Public propertyIsApplicationClosing Gets a value indicating whether the application is closing.
Public propertyShutdownToken Gets a cancellation token that gets signalled when the application is shutting down. This cancellation token may be used to stop background calculations.
Top
Methods
 NameDescription
Public methodAddBackgroundTask 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.
Public methodOnClosing Execute the closing procedure, and maybe prevent the workbench from closing by setting Cancel to true in the event args.
Public methodPreventShutdown Prevents shutdown with the following reason. Dispose the returned value to allow shutdown again.
Public methodShutdown Attemps to close the IDE.
Public methodSignalShutdownToken 
Top
Events
 NameDescription
Public eventClosed 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.
Top
See Also