mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Refactoring [WIP]
This commit is contained in:
21
Wox.Core/Plugin/JsonRPCPluginLoader.cs
Normal file
21
Wox.Core/Plugin/JsonRPCPluginLoader.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Core.Plugin
|
||||
{
|
||||
internal class JsonRPCPluginLoader<T> : IPluginLoader where T : JsonRPCPlugin, new()
|
||||
{
|
||||
public virtual IEnumerable<PluginPair> LoadPlugin(List<PluginMetadata> pluginMetadatas)
|
||||
{
|
||||
T jsonRPCPlugin = new T();
|
||||
List<PluginMetadata> jsonRPCPluginMetadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == jsonRPCPlugin.SupportedLanguage.ToUpper()).ToList();
|
||||
|
||||
return jsonRPCPluginMetadatas.Select(metadata => new PluginPair()
|
||||
{
|
||||
Plugin = jsonRPCPlugin,
|
||||
Metadata = metadata
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user