diff --git a/QuickLook/ViewWindowManager.cs b/QuickLook/ViewWindowManager.cs index fbfabe47..ac9cb14e 100644 --- a/QuickLook/ViewWindowManager.cs +++ b/QuickLook/ViewWindowManager.cs @@ -140,6 +140,30 @@ public void InvokePreview(string path = null) BeginShowNewWindow(path, matchedPlugin); } + public void InvokePluginPreview(string plugin, string path = null) + { + if (string.IsNullOrEmpty(path)) + path = _invokedPath; + + if (string.IsNullOrEmpty(path)) + return; + + if (!Directory.Exists(path) && !File.Exists(path)) + return; + + RunFocusMonitor(); + + var matchedPlugin = PluginManager.GetInstance().LoadedPlugins.Find(p => + { + return p.GetType().Assembly.GetName().Name == plugin; + }); + + if (matchedPlugin != null) + { + BeginShowNewWindow(path, matchedPlugin); + } + } + private void BeginShowNewWindow(string path, IViewer matchedPlugin) { _viewerWindow.UnloadPlugin();