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
+30
View File
@@ -0,0 +1,30 @@
using System.Runtime.InteropServices;
namespace FluidExplorer.Services.Shell;
/// <summary>
/// 资源管理器"名称"列用的排序:调用系统 shlwapi 的 StrCmpLogicalW(自然排序,数字按数值比较)。
/// 这样 "文件2" 会排在 "文件10" 前面,和原版体验一致。
/// </summary>
public sealed class NaturalStringComparer : IComparer<string>
{
public static NaturalStringComparer Instance { get; } = new();
public int Compare(string? x, string? y)
{
if (ReferenceEquals(x, y)) return 0;
if (x is null) return -1;
if (y is null) return 1;
try
{
return StrCmpLogicalW(x, y);
}
catch
{
return string.Compare(x, y, StringComparison.CurrentCultureIgnoreCase);
}
}
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
private static extern int StrCmpLogicalW(string psz1, string psz2);
}