This commit is contained in:
Paddy Xu
2017-08-06 15:06:55 +03:00
parent 768425ad0f
commit 3a20245304
41 changed files with 427 additions and 607 deletions

View File

@@ -17,6 +17,7 @@
using System;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
@@ -24,6 +25,8 @@ namespace QuickLook.Plugin.HtmlViewer
{
public class Plugin : IViewer
{
private static readonly string[] Extensions = {".mht", ".mhtml", ".htm", ".html"};
private WebpagePanel _panel;
public int Priority => int.MaxValue;
@@ -36,20 +39,7 @@ namespace QuickLook.Plugin.HtmlViewer
public bool CanHandle(string path)
{
if (Directory.Exists(path))
return false;
switch (Path.GetExtension(path).ToLower())
{
case ".mht":
case ".mhtml":
case ".html":
case ".htm":
return true;
default:
return false;
}
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
}
public void Prepare(string path, ContextObject context)