SessionToken.cs 872 B

1234567891011121314151617181920212223
  1. using System.Collections.Concurrent;
  2. namespace Terminal.Gui.App;
  3. /// <summary>
  4. /// Represents a running session created by <see cref="IApplication.Begin(IRunnable)"/>.
  5. /// Wraps an <see cref="IRunnable"/> instance and is stored in <see cref="IApplication.SessionStack"/>.
  6. /// </summary>
  7. public class SessionToken
  8. {
  9. internal SessionToken (IRunnable runnable) { Runnable = runnable; }
  10. /// <summary>
  11. /// Gets or sets the runnable associated with this session.
  12. /// Set to <see langword="null"/> by <see cref="IApplication.End(SessionToken)"/> when the session completes.
  13. /// </summary>
  14. public IRunnable? Runnable { get; internal set; }
  15. /// <summary>
  16. /// The result of the session. Typically set by the runnable in <see langword="IRunnable.IsRunningChanged"/>
  17. /// </summary>
  18. public object? Result { get; set; }
  19. }