NetComponentFactory.cs 839 B

1234567891011121314151617181920212223242526272829
  1. #nullable enable
  2. using System.Collections.Concurrent;
  3. namespace Terminal.Gui.Drivers;
  4. /// <summary>
  5. /// <see cref="IComponentFactory{T}"/> implementation for native csharp console I/O i.e. dotnet.
  6. /// This factory creates instances of internal classes <see cref="NetInput"/>, <see cref="NetOutput"/> etc.
  7. /// </summary>
  8. public class NetComponentFactory : ComponentFactory<ConsoleKeyInfo>
  9. {
  10. /// <inheritdoc/>
  11. public override IConsoleInput<ConsoleKeyInfo> CreateInput ()
  12. {
  13. return new NetInput ();
  14. }
  15. /// <inheritdoc />
  16. public override IConsoleOutput CreateOutput ()
  17. {
  18. return new NetOutput ();
  19. }
  20. /// <inheritdoc />
  21. public override IInputProcessor CreateInputProcessor (ConcurrentQueue<ConsoleKeyInfo> inputBuffer)
  22. {
  23. return new NetInputProcessor (inputBuffer);
  24. }
  25. }