mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
regular commit
This commit is contained in:
25
WinAlfred.Plugin/AllowedLanguage.cs
Normal file
25
WinAlfred.Plugin/AllowedLanguage.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WinAlfred.Plugin
|
||||
{
|
||||
public static class AllowedLanguage
|
||||
{
|
||||
public static string Python
|
||||
{
|
||||
get { return "python"; }
|
||||
}
|
||||
|
||||
public static string CSharp
|
||||
{
|
||||
get { return "csharp"; }
|
||||
}
|
||||
|
||||
public static bool IsAllowed(string language)
|
||||
{
|
||||
return language.ToUpper() == Python.ToUpper() || language.ToUpper() == CSharp.ToUpper();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
WinAlfred.Plugin/PluginMetadata.cs
Normal file
16
WinAlfred.Plugin/PluginMetadata.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WinAlfred.Plugin
|
||||
{
|
||||
public class PluginMetadata
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,23 @@ namespace WinAlfred.Plugin
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WinAlfred.Plugin
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string SubTitle { get; set; }
|
||||
public string IcoPath { get; set; }
|
||||
public Action Action { get; set; }
|
||||
public int Score { get; set; }
|
||||
public List<Result> ContextResults { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,9 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AllowedLanguage.cs" />
|
||||
<Compile Include="IPlugin.cs" />
|
||||
<Compile Include="PluginMetadata.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Query.cs" />
|
||||
<Compile Include="Result.cs" />
|
||||
|
||||
Reference in New Issue
Block a user