mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-03-06 02:02:34 +08:00
Merge InvokePluginPreview from emako/QuickLook
This commit is contained in:
@@ -140,6 +140,30 @@ internal class ViewWindowManager : IDisposable
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user