Click or drag to resize

ShutdownService Class

Coordinates the multi-stage shutdown of the application.
Inheritance Hierarchy
SystemObject
  Altaxo.Gui.WorkbenchShutdownService

Namespace: Altaxo.Gui.Workbench
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public class ShutdownService : IShutdownService

The ShutdownService type exposes the following members.

Constructors
 NameDescription
Public methodShutdownServiceInitializes a new instance of the ShutdownService class
Top
Properties
 NameDescription
Public propertyClosedAsync Occurs when the project is already closed and the rest of the shutdown procedure starts to happen. This is a weak event in order to prevent garbage collection of item that subscribe to this event. The event is raised during stage 3 OnClosingStage3_SignalShutdownToken. The tasks are executed in parallel on thread-pool threads, thus make sure that the event handlers are thread-safe.
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 application closing down.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOnClosing Executes the multi-stage application shutdown.
Protected methodOnClosingStage1_ReasonsPreventingShutdown Executes shutdown stage 1, which checks whether shutdown is currently blocked.
Protected methodOnClosingStage10_PropertyServiceSaveToFile Executes shutdown stage 10, which saves the property service to persistent storage.
Protected methodOnClosingStage2_CloseProject Executes shutdown stage 2, which closes the current project if necessary.
Protected methodOnClosingStage3_SignalShutdownToken Executes shutdown stage 3, which signals the shutdown tokens and raises shutdown events.
Protected methodOnClosingStage4_CloseAllViews Executes shutdown stage 4, which closes all views.
Protected methodOnClosingStage5_DisposePads Executes shutdown stage 5, which disposes all pads.
Protected methodOnClosingStage6_StopComServer Executes shutdown stage 6, which stops the local COM server.
Protected methodOnClosingStage7_DisposeProject Executes shutdown stage 7, which disposes the current project.
Protected methodOnClosingStage8_WaitForBackgroundTasks Executes shutdown stage 8, which waits for background tasks to complete.
Protected methodOnClosingStage9_DisposeServices Executes shutdown stage 9, which disposes registered services.
Public methodPreventShutdown Prevents shutdown with the following reason. Dispose the returned value to allow shutdown again.
Public methodShutdown Attempts to close the IDE.
Public methodSignalShutdownToken Signals the shutdown cancellation token.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventClosed Occurs when the project is already closed and the rest of the shutdown procedure starts to happen. This is a weak event in order to prevent garbage collection of item that subscribe to this event. The event is raised during stage 3 OnClosingStage3_SignalShutdownToken.
Top
See Also