PowerToys/WinAlfred/PluginLoader/PythonPluginLoader.cs

29 lines
882 B
C#
Raw Normal View History

2013-12-22 19:35:21 +08:00
using System.Collections.Generic;
2013-12-20 19:38:10 +08:00
using System.Linq;
using System.Threading;
2013-12-20 19:38:10 +08:00
using WinAlfred.Plugin;
namespace WinAlfred.PluginLoader
{
public class PythonPluginLoader : BasePluginLoader
2013-12-20 19:38:10 +08:00
{
public override List<PluginPair> LoadPlugin()
2013-12-20 19:38:10 +08:00
{
List<PluginPair> plugins = new List<PluginPair>();
List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.Python.ToUpper()).ToList();
foreach (PluginMetadata metadata in metadatas)
{
2013-12-23 19:21:51 +08:00
PythonPluginWrapper python = new PythonPluginWrapper(metadata);
PluginPair pair = new PluginPair()
{
Plugin = python,
Metadata = metadata
};
plugins.Add(pair);
}
2013-12-20 19:38:10 +08:00
return plugins;
}
}
}