EventArgs.cs 786 B

123456789101112131415161718
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. #pragma warning disable CS1711
  4. /// <summary>
  5. /// <see cref="EventArgs"/> for events that convey changes to a property of type <typeparamref name="T"/>.
  6. /// </summary>
  7. /// <typeparam name="T">The type of the value that was part of the change being canceled.</typeparam>
  8. public class EventArgs<T> : EventArgs where T : notnull
  9. {
  10. /// <summary>Initializes a new instance of the <see cref="EventArgs{T}"/> class.</summary>
  11. /// <param name="currentValue">The current value of the property.</param>
  12. /// <typeparam name="T">The type of the value.</typeparam>
  13. public EventArgs (in T currentValue) { CurrentValue = currentValue; }
  14. /// <summary>The current value of the property.</summary>
  15. public T CurrentValue { get; }
  16. }