Skip to content

Commit

Permalink
Introduce Generic priority class (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Sep 30, 2024
1 parent f5fa00a commit 801c008
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WinQuickLook.Core.Tests/WinQuickLook.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
8 changes: 6 additions & 2 deletions WinQuickLook.Core/Handlers/FilePreviewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public bool TryCreateViewer(FileSystemInfo fileSystemInfo, [NotNullWhen(true)] o
{
if (fileSystemInfo is FileInfo fileInfo)
{
if (PriorityClass == HandlerPriorityClass.Lowest)
if (PriorityClass == HandlerPriorityClass.Generic)
{
return TryCreateViewer(fileInfo, out handlerResult);
}
Expand Down Expand Up @@ -46,6 +46,10 @@ public bool TryCreateViewer(FileSystemInfo fileSystemInfo, [NotNullWhen(true)] o
".ocx",
".scr",
".sys",
".tsp"
".tsp",
".appx",
".msix",
".msixbundle",
".msixupload"
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace WinQuickLook.Handlers;

public class GenericDirectoryPreviewHandler : DirectoryPreviewHandler
{
public override HandlerPriorityClass PriorityClass => HandlerPriorityClass.Lowest;
public override HandlerPriorityClass PriorityClass => HandlerPriorityClass.Generic;

protected override bool TryCreateViewer(DirectoryInfo directoryInfo, out HandlerResult? handlerResult)
{
Expand Down
2 changes: 1 addition & 1 deletion WinQuickLook.Core/Handlers/GenericFilePreviewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace WinQuickLook.Handlers;

public class GenericFilePreviewHandler : FilePreviewHandler
{
public override HandlerPriorityClass PriorityClass => HandlerPriorityClass.Lowest;
public override HandlerPriorityClass PriorityClass => HandlerPriorityClass.Generic;

protected override bool TryCreateViewer(FileInfo fileInfo, out HandlerResult? handlerResult)
{
Expand Down
1 change: 1 addition & 0 deletions WinQuickLook.Core/Handlers/HandlerPriorityClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum HandlerPriorityClass
{
Generic = -1,
Lowest,
BelowNormal,
Normal,
Expand Down
2 changes: 1 addition & 1 deletion WinQuickLook.Core/WinQuickLook.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="Cylinder.WPF" Version="1.0.0-preview.2" />
<PackageReference Include="Markdig" Version="0.37.0" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2739.15" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2792.45" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 801c008

Please sign in to comment.