/// <summary> /// Check if dragged file is valid, /// returns false for valid file with no thumbnail, /// true for valid file with thumbnail /// and null for invalid file /// </summary> /// <param name="files"></param> /// <returns></returns> private static bool?Drag_Drop_Check(string[] files) { // Return if file strings are null if (files == null) { return(null); } if (files[0] == null) { return(null); } // Return status of useable file return(SupportedFiles.IsSupportedFileWithArchives(Path.GetExtension(files[0]))); }
internal static BitmapSource GetBitmapSourceThumb(string path) { var supported = SupportedFiles.IsSupportedFile(path); if (!supported.HasValue) { return(null); } if (supported.Value) { return(GetWindowsThumbnail(path)); } else if (!supported.Value) { return(GetMagickImage(path, 60, 55)); } return(null); }