MenuOpeningEventArgs.cs 1.0 KB

1234567891011121314151617181920212223242526
  1. namespace Terminal.Gui;
  2. #pragma warning disable CS0618 // Type or member is obsolete
  3. /// <summary>
  4. /// An <see cref="EventArgs"/> which allows passing a cancelable menu opening event or replacing with a new
  5. /// <see cref="MenuBarItem"/>.
  6. /// </summary>
  7. public class MenuOpeningEventArgs : EventArgs
  8. {
  9. /// <summary>Initializes a new instance of <see cref="MenuOpeningEventArgs"/>.</summary>
  10. /// <param name="currentMenu">The current <see cref="MenuBarItem"/> parent.</param>
  11. public MenuOpeningEventArgs (MenuBarItem currentMenu) { CurrentMenu = currentMenu; }
  12. /// <summary>
  13. /// Flag that allows the cancellation of the event. If set to <see langword="true"/> in the event handler, the
  14. /// event will be canceled.
  15. /// </summary>
  16. public bool Cancel { get; set; }
  17. /// <summary>The current <see cref="MenuBarItem"/> parent.</summary>
  18. public MenuBarItem CurrentMenu { get; }
  19. /// <summary>The new <see cref="MenuBarItem"/> to be replaced.</summary>
  20. public MenuBarItem NewMenuBarItem { get; set; }
  21. }