2
0

TextChangingEventArgs.cs 860 B

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