working on HtmlViewer

This commit is contained in:
Paddy Xu
2017-05-13 19:34:41 +03:00
parent 9e64e068d0
commit 3f82070deb
20 changed files with 637 additions and 126 deletions

View File

@@ -0,0 +1,52 @@
using System;
using System.IO;
using System.Windows;
namespace QuickLook.Plugin.HtmlViewer
{
public class Plugin : IViewer
{
private WebkitPanel _panel;
public int Priority => Int32.MaxValue;
public bool CanHandle(string path)
{
if (Directory.Exists(path))
return false;
switch (Path.GetExtension(path).ToLower())
{
case ".html":
case ".htm":
return true;
default:
return false;
}
}
public void Prepare(string path, ContextObject context)
{
context.PreferredSize = new Size(600, 800);
}
public void View(string path, ContextObject context)
{
_panel = new WebkitPanel();
context.ViewerContent = _panel;
_panel.Navigate(path);
context.IsBusy = false;
}
public void Dispose()
{
}
~Plugin()
{
Dispose();
}
}
}