Use own Pdf viewer implementation. wip on universal InfoPanel

This commit is contained in:
Paddy Xu
2017-04-16 01:18:54 +03:00
parent 7388c3874a
commit 431cf1f014
35 changed files with 2894 additions and 213 deletions

View File

@@ -11,18 +11,27 @@ namespace QuickLook
{
private static PluginManager _instance;
internal PluginManager()
private PluginManager()
{
LoadPlugins();
}
internal List<IViewer> LoadedPlugins { get; } = new List<IViewer>();
internal List<IViewer> LoadedPlugins { get; private set; } = new List<IViewer>();
internal static PluginManager GetInstance()
{
return _instance ?? (_instance = new PluginManager());
}
internal static IViewer FindMatch(string path)
{
if (string.IsNullOrEmpty(path))
return null;
return GetInstance()
.LoadedPlugins.FirstOrDefault(plugin => plugin.CanHandle(path));
}
private void LoadPlugins()
{
Directory.GetFiles(Path.Combine(App.AppPath, "Plugins\\"), "QuickLook.Plugin.*.dll",
@@ -37,6 +46,8 @@ namespace QuickLook
select t).ToList()
.ForEach(type => LoadedPlugins.Add((IViewer) Activator.CreateInstance(type)));
});
LoadedPlugins = LoadedPlugins.OrderByDescending(i => i.Priority).ToList();
}
}
}