修复一个测试遗留bug

This commit is contained in:
liufei
2021-12-20 16:39:51 +08:00
parent 0f6119c0ba
commit 37e8631f73
5 changed files with 20 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
@@ -13,6 +14,7 @@ namespace GeekDesk.Util
{
class ImageUtil
{
private static readonly string SYSTEM_ITEM = "::{.*}";
/// <summary>
/// 图片数组转 BitmapImage
@@ -84,7 +86,7 @@ namespace GeekDesk.Util
/// <returns></returns>
public static BitmapImage GetBitmapIconByPath(string filePath)
{
if (File.Exists(filePath))
if (File.Exists(filePath) || IsSystemItem(filePath))
{
if (IsImage(filePath)) {
//图片
@@ -334,5 +336,15 @@ namespace GeekDesk.Util
}
/// <summary>
/// 判断是否为系统项
/// </summary>
/// <returns></returns>
public static bool IsSystemItem(string path)
{
return Regex.IsMatch(path, SYSTEM_ITEM);
}
}
}