1
0
mirror of https://github.com/chylex/Query.git synced 2025-08-18 20:24:54 +02:00
Files
AppCalc
AppConv
AppMeme
AppWindows
Handlers
Properties
App.cs
AppSys.csproj
IHandler.cs
Base
Query
.gitignore
Query.sln
icon.ico
Query/AppWindows/App.cs
2024-07-29 16:57:33 +02:00

27 lines
701 B
C#

using System.Linq;
using AppSys.Handlers;
using Base;
namespace AppSys{
public sealed class App : IApp{
private static readonly IHandler[] Handlers = {
new HandlerProcesses(),
new HandlerApps()
};
public string[] RecognizedNames => new string[]{
"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);
}
}
}