EventArgs.cs 922 B

12345678910111213141516171819202122
  1. #nullable enable
  2. namespace Terminal.Gui.App;
  3. #pragma warning disable CS1711
  4. /// <summary>
  5. /// Provides data for events that convey the current value of a property or other value in a cancellable workflow (CWP).
  6. /// </summary>
  7. /// <remarks>
  8. /// Used for workflows where the current value of a property or value is being conveyed, such as
  9. /// when a property has been changed.
  10. /// </remarks>
  11. /// <typeparam name="T">The type of the value.</typeparam>
  12. public class EventArgs<T> : EventArgs /*where T : notnull*/
  13. {
  14. /// <summary>Initializes a new instance of the <see cref="EventArgs{T}"/> class.</summary>
  15. /// <param name="currentValue">The current value of the property.</param>
  16. /// <typeparam name="T">The type of the value.</typeparam>
  17. public EventArgs (in T currentValue) { Value = currentValue; }
  18. /// <summary>The current value of the property.</summary>
  19. public T Value { get; }
  20. }