mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
FileSystemPlugin
Check for invalid paths [Open this directory] Action always appears at top is path is existing directory or parent is
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Wox.PluginLoader {
|
||||
public class CSharpPluginLoader : BasePluginLoader {
|
||||
|
||||
public override List<PluginPair> LoadPlugin() {
|
||||
List<PluginPair> plugins = new List<PluginPair>();
|
||||
var plugins = new List<PluginPair>();
|
||||
|
||||
List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.CSharp.ToUpper()).ToList();
|
||||
foreach (PluginMetadata metadata in metadatas) {
|
||||
@@ -19,7 +19,7 @@ namespace Wox.PluginLoader {
|
||||
Assembly asm = Assembly.Load(AssemblyName.GetAssemblyName(metadata.ExecuteFilePath));
|
||||
List<Type> types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && (o.BaseType == typeof(BaseSystemPlugin) || o.GetInterfaces().Contains(typeof(IPlugin)))).ToList();
|
||||
if (types.Count == 0) {
|
||||
Log.Warn(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin", metadata.Name));
|
||||
Log.Warn(string.Format("Couldn't load plugin {0}: didn't find the class who implement IPlugin", metadata.Name));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Wox.PluginLoader {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.Error(string.Format("Cound't load plugin {0}: {1}", metadata.Name, e.Message));
|
||||
Log.Error(string.Format("Couldn't load plugin {0}: {1}", metadata.Name, e.Message));
|
||||
#if (DEBUG)
|
||||
{
|
||||
throw;
|
||||
|
||||
Reference in New Issue
Block a user