MenuOpeningEventArgs.cs 1001 B

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