regular commit

This commit is contained in:
qianlifeng
2013-12-20 19:38:10 +08:00
parent c8fca3d63f
commit f25f4f7dc8
17 changed files with 489 additions and 11 deletions

View 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();
}
}
}

View 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; }
}
}

View File

@@ -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]);
}
}
}
}
}

View File

@@ -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; }
}
}

View File

@@ -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" />