WizardEventArgs.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using static Terminal.Gui.Wizard;
  3. namespace Terminal.Gui {
  4. /// <summary>
  5. /// <see cref="EventArgs"/> for <see cref="WizardStep"/> transition events.
  6. /// </summary>
  7. public class WizardButtonEventArgs : EventArgs {
  8. /// <summary>
  9. /// Set to true to cancel the transition to the next step.
  10. /// </summary>
  11. public bool Cancel { get; set; }
  12. /// <summary>
  13. /// Initializes a new instance of <see cref="WizardButtonEventArgs"/>
  14. /// </summary>
  15. public WizardButtonEventArgs ()
  16. {
  17. Cancel = false;
  18. }
  19. }
  20. /// <summary>
  21. /// <see cref="EventArgs"/> for <see cref="WizardStep"/> events.
  22. /// </summary>
  23. public class StepChangeEventArgs : EventArgs {
  24. /// <summary>
  25. /// The current (or previous) <see cref="WizardStep"/>.
  26. /// </summary>
  27. public WizardStep OldStep { get; }
  28. /// <summary>
  29. /// The <see cref="WizardStep"/> the <see cref="Wizard"/> is changing to or has changed to.
  30. /// </summary>
  31. public WizardStep NewStep { get; }
  32. /// <summary>
  33. /// Event handlers can set to true before returning to cancel the step transition.
  34. /// </summary>
  35. public bool Cancel { get; set; }
  36. /// <summary>
  37. /// Initializes a new instance of <see cref="StepChangeEventArgs"/>
  38. /// </summary>
  39. /// <param name="oldStep">The current <see cref="WizardStep"/>.</param>
  40. /// <param name="newStep">The new <see cref="WizardStep"/>.</param>
  41. public StepChangeEventArgs (WizardStep oldStep, WizardStep newStep)
  42. {
  43. OldStep = oldStep;
  44. NewStep = newStep;
  45. Cancel = false;
  46. }
  47. }
  48. }