mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-14 03:29:07 +00:00
Use own Pdf viewer implementation. wip on universal InfoPanel
This commit is contained in:
33
QuickLook.Plugin.LastResort/Plugin.cs
Normal file
33
QuickLook.Plugin.LastResort/Plugin.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Drawing;
|
||||
using System.Windows;
|
||||
using Size = System.Windows.Size;
|
||||
|
||||
namespace QuickLook.Plugin.LastResort
|
||||
{
|
||||
public class Plugin : IViewer
|
||||
{
|
||||
private InfoPanel ip;
|
||||
public int Priority => -9999;
|
||||
|
||||
public bool CanHandle(string sample)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void View(string path, ViewContentContainer container)
|
||||
{
|
||||
var s = IconHelper.GetBitmapFromPath(path, IconHelper.IconSizeEnum.ExtraLargeIcon).ToBitmapSource();
|
||||
|
||||
ip = new InfoPanel();
|
||||
ip.image.Source = s;
|
||||
|
||||
container.SetContent(ip);
|
||||
container.PreferedSize = new Size {Width = ip.Width, Height = ip.Height};
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
//ip.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user