TimeoutEventArgs.cs 856 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Terminal.Gui;
  3. using static Terminal.Gui.MainLoop;
  4. namespace Terminal.Gui {
  5. /// <summary>
  6. /// <see cref="EventArgs"/> for timeout events (e.g. <see cref="MainLoop.TimeoutAdded"/>)
  7. /// </summary>
  8. public class TimeoutEventArgs : EventArgs {
  9. /// <summary>
  10. /// Gets the timeout callback handler
  11. /// </summary>
  12. public Timeout Timeout { get; }
  13. /// <summary>
  14. /// Gets the <see cref="DateTime.Ticks"/> in UTC time when the
  15. /// <see cref="Timeout"/> will next execute after.
  16. /// </summary>
  17. public long Ticks { get; }
  18. /// <summary>
  19. /// Creates a new instance of the <see cref="TimeoutEventArgs"/> class.
  20. /// </summary>
  21. /// <param name="timeout"></param>
  22. /// <param name="ticks"></param>
  23. public TimeoutEventArgs (Timeout timeout, long ticks)
  24. {
  25. this.Timeout = timeout;
  26. this.Ticks = ticks;
  27. }
  28. }
  29. }