TextChangingEventArgs.cs 778 B

12345678910111213141516171819202122
  1. //
  2. // TextField.cs: single-line text editor with Emacs keybindings
  3. //
  4. // Authors:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. namespace Terminal.Gui;
  8. /// <summary>An <see cref="EventArgs"/> which allows passing a cancelable new text value event.</summary>
  9. public class TextChangingEventArgs : EventArgs
  10. {
  11. /// <summary>Initializes a new instance of <see cref="TextChangingEventArgs"/></summary>
  12. /// <param name="newText">The new <see cref="TextField.Text"/> to be replaced.</param>
  13. public TextChangingEventArgs (string newText) { NewText = newText; }
  14. /// <summary>Flag which allows to cancel the new text value.</summary>
  15. public bool Cancel { get; set; }
  16. /// <summary>The new text to be replaced.</summary>
  17. public string NewText { get; set; }
  18. }