Shutdown |
public class ShutdownService : IShutdownService
The ShutdownService type exposes the following members.
| Name | Description | |
|---|---|---|
| ShutdownService | Initializes a new instance of the ShutdownService class |
| Name | Description | |
|---|---|---|
| ClosedAsync | 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. | |
| 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 application closing down. | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| OnClosing | Executes the multi-stage application shutdown. | |
| OnClosingStage1_ReasonsPreventingShutdown | Executes shutdown stage 1, which checks whether shutdown is currently blocked. | |
| OnClosingStage10_PropertyServiceSaveToFile | Executes shutdown stage 10, which saves the property service to persistent storage. | |
| OnClosingStage2_CloseProject | Executes shutdown stage 2, which closes the current project if necessary. | |
| OnClosingStage3_SignalShutdownToken | Executes shutdown stage 3, which signals the shutdown tokens and raises shutdown events. | |
| OnClosingStage4_CloseAllViews | Executes shutdown stage 4, which closes all views. | |
| OnClosingStage5_DisposePads | Executes shutdown stage 5, which disposes all pads. | |
| OnClosingStage6_StopComServer | Executes shutdown stage 6, which stops the local COM server. | |
| OnClosingStage7_DisposeProject | Executes shutdown stage 7, which disposes the current project. | |
| OnClosingStage8_WaitForBackgroundTasks | Executes shutdown stage 8, which waits for background tasks to complete. | |
| OnClosingStage9_DisposeServices | Executes shutdown stage 9, which disposes registered services. | |
| PreventShutdown | Prevents shutdown with the following reason. Dispose the returned value to allow shutdown again. | |
| Shutdown | Attempts to close the IDE. | |
| SignalShutdownToken | Signals the shutdown cancellation token. | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| Closed | 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. |