namespace Terminal.Gui.App; /// /// Event args for lifecycle events that provide information about the runnable. /// /// /// Used for post-notification events that cannot be canceled: /// and . /// public class RunnableEventArgs : EventArgs { /// /// Initializes a new instance of . /// /// The runnable involved in the event. public RunnableEventArgs (IRunnable runnable) { Runnable = runnable; } /// /// Gets the runnable involved in the event. /// public IRunnable Runnable { get; } } /// /// Event args for event. Allows cancellation. /// /// /// This event is raised when a runnable session is about to become active. It can be canceled /// by setting to . /// public class RunnableActivatingEventArgs : System.ComponentModel.CancelEventArgs { /// /// Initializes a new instance of . /// /// The runnable that is being activated. /// The runnable that is being deactivated, or null if none. public RunnableActivatingEventArgs (IRunnable activating, IRunnable? deactivated) { Activating = activating; Deactivated = deactivated; } /// /// Gets the runnable that is being activated. /// public IRunnable Activating { get; } /// /// Gets the runnable that is being deactivated, or null if none. /// public IRunnable? Deactivated { get; } } /// /// Event args for event. Allows cancellation. /// /// /// This event is raised when a runnable session is about to cease being active. It can be canceled /// by setting to . /// public class RunnableDeactivatingEventArgs : System.ComponentModel.CancelEventArgs { /// /// Initializes a new instance of . /// /// The runnable that is being deactivated. /// The runnable that is being activated, or null if none. public RunnableDeactivatingEventArgs (IRunnable deactivating, IRunnable? activated) { Deactivating = deactivating; Activated = activated; } /// /// Gets the runnable that is being deactivated. /// public IRunnable Deactivating { get; } /// /// Gets the runnable that is being activated, or null if none. /// public IRunnable? Activated { get; } }