WizardEventArgs.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace Terminal.Gui;
  2. /// <summary><see cref="EventArgs"/> for <see cref="WizardStep"/> transition events.</summary>
  3. public class WizardButtonEventArgs : EventArgs
  4. {
  5. /// <summary>Initializes a new instance of <see cref="WizardButtonEventArgs"/></summary>
  6. public WizardButtonEventArgs () { Cancel = false; }
  7. /// <summary>Set to true to cancel the transition to the next step.</summary>
  8. public bool Cancel { get; set; }
  9. }
  10. /// <summary><see cref="EventArgs"/> for <see cref="WizardStep"/> events.</summary>
  11. public class StepChangeEventArgs : EventArgs
  12. {
  13. /// <summary>Initializes a new instance of <see cref="StepChangeEventArgs"/></summary>
  14. /// <param name="oldStep">The current <see cref="WizardStep"/>.</param>
  15. /// <param name="newStep">The new <see cref="WizardStep"/>.</param>
  16. public StepChangeEventArgs (WizardStep oldStep, WizardStep newStep)
  17. {
  18. OldStep = oldStep;
  19. NewStep = newStep;
  20. Cancel = false;
  21. }
  22. /// <summary>Event handlers can set to true before returning to cancel the step transition.</summary>
  23. public bool Cancel { get; set; }
  24. /// <summary>The <see cref="WizardStep"/> the <see cref="Wizard"/> is changing to or has changed to.</summary>
  25. public WizardStep NewStep { get; }
  26. /// <summary>The current (or previous) <see cref="WizardStep"/>.</summary>
  27. public WizardStep OldStep { get; }
  28. }