WindowsComponentFactory.cs 877 B

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