| | | 1 | | using System.Collections.Generic; |
| | | 2 | | using System.Threading; |
| | | 3 | | using System.Threading.Tasks; |
| | | 4 | | using SwitchBlade.Contracts; |
| | | 5 | | |
| | | 6 | | namespace SwitchBlade.Services |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// No-op implementation of IUiaWorkerClient used in tests and when |
| | | 10 | | /// no UIA providers are registered. Returns empty results. |
| | | 11 | | /// </summary> |
| | | 12 | | internal sealed class NullUiaWorkerClient : IUiaWorkerClient |
| | | 13 | | { |
| | | 14 | | public async IAsyncEnumerable<UiaPluginResult> ScanStreamingAsync( |
| | | 15 | | IEnumerable<string>? disabledPlugins = null, |
| | | 16 | | IEnumerable<string>? excludedProcesses = null, |
| | | 17 | | [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default) |
| | 1 | 18 | | { |
| | 1 | 19 | | await Task.CompletedTask; |
| | 1 | 20 | | yield break; |
| | 1 | 21 | | } |
| | | 22 | | |
| | | 23 | | public Task<List<WindowItem>> ScanAsync( |
| | | 24 | | IEnumerable<string>? disabledPlugins = null, |
| | | 25 | | IEnumerable<string>? excludedProcesses = null, |
| | | 26 | | CancellationToken cancellationToken = default) |
| | 1 | 27 | | { |
| | 1 | 28 | | return Task.FromResult(new List<WindowItem>()); |
| | 1 | 29 | | } |
| | | 30 | | |
| | 2 | 31 | | public void Dispose() { } |
| | | 32 | | } |
| | | 33 | | } |