fix some register issue

This commit is contained in:
2021-12-28 17:24:41 +08:00
parent c03de86d02
commit 3007e0639c
4 changed files with 16 additions and 8 deletions

View File

@ -339,7 +339,7 @@ namespace ShellExtensions
private static void ThrowIfNotValid(Type type)
{
var interfaces = type.GetInterfaces();
if (!interfaces.Any(x => x is IPreviewFromStream || x is IPreviewFromFile))
if (!interfaces.Any(x => x == typeof(IPreviewFromStream) || x == typeof(IPreviewFromFile)))
{
throw new NotImplementedException(
string.Format(System.Globalization.CultureInfo.InvariantCulture,

View File

@ -1,4 +1,4 @@
#if PREVIEW_HANDLER
#if PREVIEW_HANDLER_WINFORM
using ShellExtensions.Interop;
using ShellExtensions.Interop.Common;
using ShellExtensions.Resources;

View File

@ -200,9 +200,9 @@ namespace ShellExtensions
}
var interfaces = type.GetInterfaces();
bool interfaced = interfaces.Any(x => x is IThumbnailFromStream);
bool interfaced = interfaces.Any(x => x == typeof(IThumbnailFromStream));
if (interfaces.Any(x => x is IThumbnailFromFile))
if (interfaces.Any(x => x == typeof(IThumbnailFromFile)))
{
// According to MSDN (http://msdn.microsoft.com/en-us/library/cc144114(v=VS.85).aspx)
// A thumbnail provider that does not implement IInitializeWithStream must opt out of