From 7ce6a6abc047a23f27f48762b0581965d9669977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E7=8C=AB=E8=B7=83?= <1043137532@qq.com> Date: Mon, 22 Jun 2026 20:22:22 +0800 Subject: [PATCH] * --- Shared/Utils/PathUtils.cs | 9 +++++++-- Wpf/Controls/ModernTooltipService.cs | 11 ----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Shared/Utils/PathUtils.cs b/Shared/Utils/PathUtils.cs index 02b362e..2e241ac 100644 --- a/Shared/Utils/PathUtils.cs +++ b/Shared/Utils/PathUtils.cs @@ -157,8 +157,13 @@ public static class PathUtils { /// 统一路径格式,以便比较。 /// 具体而言:将短路径展开,去除前导的 \\?\,将分隔符改为 \,去除末尾的分隔符。 /// - public static string ForCompare(string pathName) - => PathUtils.RemoveSlashSuffix(PathUtils.RemoveExtendedPrefix(Path.GetFullPath(pathName)).Replace("/", @"\")); + public static string ForCompare(string pathName) { + try { + return PathUtils.RemoveSlashSuffix(PathUtils.RemoveExtendedPrefix(Path.GetFullPath(pathName)).Replace("/", @"\")); + } catch (ArgumentException ex) { + throw new ArgumentException($"路径不正确:{pathName}", ex); + } + } /// /// 将路径转换为兼容各种 Windows API 的格式。 diff --git a/Wpf/Controls/ModernTooltipService.cs b/Wpf/Controls/ModernTooltipService.cs index 5f65a6f..80edb38 100644 --- a/Wpf/Controls/ModernTooltipService.cs +++ b/Wpf/Controls/ModernTooltipService.cs @@ -124,17 +124,6 @@ public static class ModernTooltipService { private static void OnMouseLeave(object sender, MouseEventArgs e) { if (sender is not FrameworkElement owner || !ReferenceEquals(owner, currentOwner)) return; - if (sender is TextBox box) { - Logger.Warn("MOUSELEAVE: " + ( - $"Leave: IsMouseOver={box.IsMouseOver}, " + - $"Captured={Mouse.Captured}, " + - $"DirectlyOver={Mouse.DirectlyOver}, " + - $"OriginalSource={e.OriginalSource}"), LogBehavior.None); - } - Logger.Warn("MOUSELEAVE: " + sender.GetType().Name + ", " + - $"Captured={Mouse.Captured}, " + - $"DirectlyOver={Mouse.DirectlyOver}, " + - $"OriginalSource={e.OriginalSource}", LogBehavior.None); if (!(owner.IsEnabled || !ToolTipService.GetShowOnDisabled(owner) || !IsPointInside(owner, Mouse.GetPosition(owner)))) return;