Initial commit: FluidExplorer:从零实现的 WinUI 3 文件资源管理器替代品(Mica、命令栏、面包屑)

This commit is contained in:
WpyQwq
2026-09-19 11:54:03 +08:00
commit 5780fde61a
60 changed files with 15035 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml.Media;
namespace FluidExplorer.Services.Icons;
/// <summary>
/// 图标/缩略图服务:全部来自 Windows 外壳(imageres.dll 等系统图标库、IShellItemImageFactory),
/// 也就是资源管理器本身显示的那批原版图标,不做自制图标。
/// </summary>
public interface IIconService
{
/// <summary>系统小图标(16/32/48px 的多尺寸 HICON),用于列表与侧边栏。目录、驱动器、特殊文件夹同样走外壳。</summary>
Task<ImageSource?> GetIconAsync(string path, bool isDirectory, int size, CancellationToken cancellationToken);
/// <summary>大缩略图(SIIGBF_THUMBNAILONLY + 图标回退),用于网格/磁贴视图。失败返回 null。</summary>
Task<ImageSource?> GetThumbnailAsync(string path, int size, CancellationToken cancellationToken);
/// <summary>按扩展名取通用图标(同类型文件共用一个位图,命中率极高)。</summary>
Task<ImageSource?> GetExtensionIconAsync(string extension, int size, CancellationToken cancellationToken);
/// <summary>取某个已知外壳文件夹(如 "shell:RecycleBinFolder"、"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")的图标。</summary>
ImageSource? GetSpecialFolderIcon(string parsingName, int size);
void ClearCache();
}
/// <summary>图标服务需要在 UI 线程创建 ImageSource,构造时注入 DispatcherQueue。</summary>
public interface IIconServiceHost
{
DispatcherQueue DispatcherQueue { get; }
}