diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index a02e4b1f..3462638a 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -2416,7 +2416,7 @@ namespace Ink_Canvas if (slider == null) return; // 捕获触摸设备 - if (e.RoutedEvent == UIElement.TouchDownEvent) + if (e.RoutedEvent == TouchDownEvent) { slider.CaptureTouch(e.TouchDevice); } @@ -2451,7 +2451,7 @@ namespace Ink_Canvas if (slider == null) return; // 捕获手写笔设备 - if (e.RoutedEvent == UIElement.StylusDownEvent) + if (e.RoutedEvent == StylusDownEvent) { slider.CaptureStylus(); } @@ -2619,7 +2619,7 @@ namespace Ink_Canvas { try { - var toggle = sender as iNKORE.UI.WPF.Modern.Controls.ToggleSwitch; + var toggle = sender as ToggleSwitch; if (toggle != null) { Settings.ModeSettings.IsPPTOnlyMode = toggle.IsOn; diff --git a/Ink Canvas/MainWindow_cs/MW_Eraser.cs b/Ink Canvas/MainWindow_cs/MW_Eraser.cs index d49cfe1a..85ee7dcf 100644 --- a/Ink Canvas/MainWindow_cs/MW_Eraser.cs +++ b/Ink Canvas/MainWindow_cs/MW_Eraser.cs @@ -750,6 +750,10 @@ namespace Ink_Canvas { overlay.CaptureMouse(); StartAdvancedEraserOperation(sender); + + // 处理单点擦除 + var position = e.GetPosition((UIElement)FindName("inkCanvas")); + UpdateAdvancedEraserPosition(sender, position); } }; @@ -787,6 +791,10 @@ namespace Ink_Canvas overlay.CaptureStylus(); } StartAdvancedEraserOperation(sender); + + // 处理单点擦除 + var position = e.GetPosition((UIElement)FindName("inkCanvas")); + UpdateAdvancedEraserPosition(sender, position); } }; diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 7a9c77c0..72d4fe93 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -232,10 +232,10 @@ namespace Ink_Canvas pptApplication = new Microsoft.Office.Interop.PowerPoint.Application(); // 设置为不可见,作为后台进程 - pptApplication.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; + pptApplication.Visible = MsoTriState.msoFalse; // 设置应用程序属性 - pptApplication.WindowState = Microsoft.Office.Interop.PowerPoint.PpWindowState.ppWindowMinimized; + pptApplication.WindowState = PpWindowState.ppWindowMinimized; // 直接设置PPTManager的PPTApplication属性,绕过COM注册问题 Task.Delay(1000).ContinueWith(_ => diff --git a/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs b/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs index bb7f41df..b6e1f3c8 100644 --- a/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/HotkeySettingsWindow.xaml.cs @@ -66,10 +66,10 @@ namespace Ink_Canvas.Windows try { // 设置窗口启动位置为屏幕中心 - this.WindowStartupLocation = WindowStartupLocation.CenterScreen; + WindowStartupLocation = WindowStartupLocation.CenterScreen; // 确保窗口在显示时获得焦点 - this.ShowInTaskbar = true; + ShowInTaskbar = true; LogHelper.WriteLogToFile("快捷键设置窗口属性已设置"); } @@ -540,7 +540,7 @@ namespace Ink_Canvas.Windows /// /// 标题栏拖拽事件 /// - private void TitleBar_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + private void TitleBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { diff --git a/Ink Canvas/Windows/RandWindow.xaml.cs b/Ink Canvas/Windows/RandWindow.xaml.cs index c80ed0a4..bada95f6 100644 --- a/Ink Canvas/Windows/RandWindow.xaml.cs +++ b/Ink Canvas/Windows/RandWindow.xaml.cs @@ -121,7 +121,7 @@ namespace Ink_Canvas if (RandMaxPeopleOneTime != -1 && TotalCount >= RandMaxPeopleOneTime) return; TotalCount++; LabelNumberCount.Text = TotalCount.ToString(); - SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.People; + SymbolIconStart.Symbol = Symbol.People; BorderBtnAdd.Opacity = 1; BorderBtnMinus.Opacity = 1; } @@ -133,7 +133,7 @@ namespace Ink_Canvas LabelNumberCount.Text = TotalCount.ToString(); if (TotalCount == 1) { - SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Contact; + SymbolIconStart.Symbol = Symbol.Contact; } } diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs index 30dffb67..75dd183e 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs @@ -43,7 +43,7 @@ namespace Ink_Canvas.Windows.SettingsViews { } // 关于页面构建时间 - var buildTime = FileBuildTimeHelper.GetBuildDateTime(System.Reflection.Assembly.GetExecutingAssembly()); + var buildTime = FileBuildTimeHelper.GetBuildDateTime(Assembly.GetExecutingAssembly()); if (buildTime != null) { var bt = ((DateTimeOffset)buildTime).LocalDateTime; var m = bt.Month.ToString().PadLeft(2, '0'); @@ -69,7 +69,7 @@ namespace Ink_Canvas.Windows.SettingsViews { } public static class TouchTabletDetectHelper { - [System.Runtime.InteropServices.DllImport("user32.dll")] + [DllImport("user32.dll")] public static extern int GetSystemMetrics(int nIndex); public static bool IsTouchEnabled() @@ -84,9 +84,9 @@ namespace Ink_Canvas.Windows.SettingsViews { { public USBDeviceInfo(string deviceID, string pnpDeviceID, string description) { - this.DeviceID = deviceID; - this.PnpDeviceID = pnpDeviceID; - this.Description = description; + DeviceID = deviceID; + PnpDeviceID = pnpDeviceID; + Description = description; } public string DeviceID { get; private set; } public string PnpDeviceID { get; private set; } diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs index ded95ef8..fa4b54d8 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs @@ -237,14 +237,14 @@ namespace Ink_Canvas.Windows { public ImageSource IconSource { get; set; } public bool Selected { get; set; } public Visibility _spVisibility { - get => this.Type == SidebarItemType.Separator ? Visibility.Visible : Visibility.Collapsed; + get => Type == SidebarItemType.Separator ? Visibility.Visible : Visibility.Collapsed; } public Visibility _siVisibility { - get => this.Type == SidebarItemType.Item ? Visibility.Visible : Visibility.Collapsed; + get => Type == SidebarItemType.Item ? Visibility.Visible : Visibility.Collapsed; } public SolidColorBrush _siBackground { - get => this.Selected + get => Selected ? new SolidColorBrush(Color.FromRgb(217, 217, 217)) : new SolidColorBrush(Colors.Transparent); } @@ -622,7 +622,7 @@ namespace Ink_Canvas.Windows { catch (Exception ex) { // 记录错误但不影响程序运行 - System.Diagnostics.Debug.WriteLine($"添加自定义滑块触摸支持时出错: {ex.Message}"); + Debug.WriteLine($"添加自定义滑块触摸支持时出错: {ex.Message}"); } } @@ -930,7 +930,7 @@ namespace Ink_Canvas.Windows { } catch (Exception ex) { - System.Diagnostics.Debug.WriteLine($"更新自定义滑块值时出错: {ex.Message}"); + Debug.WriteLine($"更新自定义滑块值时出错: {ex.Message}"); } }