mirror of
https://github.com/chylex/Query.git
synced 2025-04-28 17:15:43 +02:00
26 lines
537 B
C#
26 lines
537 B
C#
using System.Linq;
|
|
using AppSys.Handlers;
|
|
using Base;
|
|
|
|
namespace AppSys;
|
|
|
|
public sealed class App : IApp {
|
|
private static readonly IHandler[] Handlers = [
|
|
new HandlerProcesses()
|
|
];
|
|
|
|
public string[] RecognizedNames => [
|
|
"sys",
|
|
"os",
|
|
"win"
|
|
];
|
|
|
|
public MatchConfidence GetConfidence(Command cmd) {
|
|
return Handlers.Any(handler => handler.Matches(cmd)) ? MatchConfidence.Full : MatchConfidence.None;
|
|
}
|
|
|
|
public string? ProcessCommand(Command cmd) {
|
|
return Handlers.First(handler => handler.Matches(cmd)).Handle(cmd);
|
|
}
|
|
}
|