mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 18:29:24 +08:00
34 lines
852 B
C#
34 lines
852 B
C#
using System.Collections.Generic;
|
|
|
|
namespace WinAlfred.Plugin
|
|
{
|
|
public class Query
|
|
{
|
|
public string RawQuery { get; set; }
|
|
public string ActionName { get; private set; }
|
|
public List<string> ActionParameters { get; private set; }
|
|
|
|
public Query(string rawQuery)
|
|
{
|
|
RawQuery = rawQuery;
|
|
ActionParameters = new List<string>();
|
|
ParseQuery();
|
|
}
|
|
|
|
private void ParseQuery()
|
|
{
|
|
if (string.IsNullOrEmpty(RawQuery)) return;
|
|
|
|
string[] strings = RawQuery.Split(' ');
|
|
ActionName = strings[0];
|
|
if (strings.Length > 1)
|
|
{
|
|
for (int i = 1; i < strings.Length; i++)
|
|
{
|
|
ActionParameters.Add(strings[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|