优化代码

This commit is contained in:
2026-04-30 14:29:06 +08:00
parent 988af60a30
commit d30ed9e726
35 changed files with 46 additions and 85 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
@@ -1,5 +1,4 @@
using OSVersionExtension;
using System;
using System.Windows;
using System.Windows.Ink;
using System.Windows.Media;
+1 -3
View File
@@ -1,6 +1,6 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using Ink_Canvas.Windows;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Controls;
using Microsoft.Win32;
@@ -13,7 +13,6 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
@@ -32,7 +31,6 @@ using Cursor = System.Windows.Input.Cursor;
using Cursors = System.Windows.Input.Cursors;
using DpiChangedEventArgs = System.Windows.DpiChangedEventArgs;
using File = System.IO.File;
using GroupBox = System.Windows.Controls.GroupBox;
using HorizontalAlignment = System.Windows.HorizontalAlignment;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
using Point = System.Windows.Point;
-1
View File
@@ -4,7 +4,6 @@ using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
@@ -3,10 +3,8 @@ using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace Ink_Canvas
{
-2
View File
@@ -1,13 +1,11 @@
using Ink_Canvas.Helpers;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
namespace Ink_Canvas
@@ -1,6 +1,5 @@
using Ink_Canvas.Controls;
using Ink_Canvas.Helpers;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using iNKORE.UI.WPF.Modern;
using System;
using System.Diagnostics;
@@ -1,6 +1,5 @@
using Ink_Canvas.Helpers;
using System;
using System.Linq;
using System.Windows;
namespace Ink_Canvas
@@ -1,6 +1,5 @@
using Ink_Canvas.Controls;
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
-15
View File
@@ -1,32 +1,17 @@
using H.NotifyIcon;
using Ink_Canvas.Helpers;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using Newtonsoft.Json;
using OSVersionExtension;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using Application = System.Windows.Application;
using CheckBox = System.Windows.Controls.CheckBox;
using ComboBox = System.Windows.Controls.ComboBox;
using File = System.IO.File;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
using OperatingSystem = OSVersionExtension.OperatingSystem;
using RadioButton = System.Windows.Controls.RadioButton;
namespace Ink_Canvas
@@ -1,11 +1,9 @@
using H.NotifyIcon;
using Ink_Canvas.Helpers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OSVersionExtension;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Ink;
@@ -9,7 +9,6 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
-1
View File
@@ -1,5 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Plugins;
namespace Ink_Canvas.Plugins
{
-2
View File
@@ -1,7 +1,5 @@
using Ink_Canvas.Plugins;
using System;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Ink_Canvas.Plugins
{
@@ -5,7 +5,6 @@ using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
@@ -1,6 +1,5 @@
using IWshRuntimeLibrary;
using System;
using System.IO;
using File = System.IO.File;
namespace Ink_Canvas.Windows.SettingsViews.Helpers
@@ -1,10 +1,10 @@
using Ink_Canvas.Helpers;
using System;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Threading;
using Ink_Canvas.Helpers;
namespace Ink_Canvas.Windows.SettingsViews.Helpers
{
@@ -7,7 +7,6 @@ using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using ContentDialog = iNKORE.UI.WPF.Modern.Controls.ContentDialog;
using MessageBox = System.Windows.MessageBox;
using Page = iNKORE.UI.WPF.Modern.Controls.Page;
@@ -354,7 +354,9 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
{
var checkBox = new CheckBox
{
Content = category.Value, Tag = category.Key, FontSize = 13,
Content = category.Value,
Tag = category.Key,
FontSize = 13,
IsChecked = implicitAllCategories || savedHitokoto.Contains(category.Key),
Margin = new Thickness(0, 0, 0, 8)
};
@@ -89,7 +89,12 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
CardAutoDelSavedFiles.IsOn = auto.AutoDelSavedFiles;
ComboBoxAutoDelSavedFilesDaysThreshold.SelectedIndex = auto.AutoDelSavedFilesDaysThreshold switch
{
7 => 0, 14 => 1, 30 => 2, 60 => 3, 90 => 4, _ => 2
7 => 0,
14 => 1,
30 => 2,
60 => 3,
90 => 4,
_ => 2
};
SideControlMinimumAutomationSlider.Value = auto.MinimumAutomationStrokeNumber;
@@ -1,6 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@@ -6,7 +6,6 @@ using System.Linq;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Navigation;
using System.Windows.Media;
using MessageBox = System.Windows.MessageBox;
using Screen = System.Windows.Forms.Screen;
@@ -1,4 +1,3 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -1,7 +1,7 @@
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
namespace Ink_Canvas.Controls
{
@@ -1,5 +1,3 @@
using System;
namespace Ink_Canvas.Plugins
{
public interface IAppRestartService
-1
View File
@@ -1,4 +1,3 @@
using System;
using System.Threading.Tasks;
namespace Ink_Canvas.Plugins
-2
View File
@@ -1,5 +1,3 @@
using System;
namespace Ink_Canvas.Plugins
{
public interface IPlugin
-2
View File
@@ -1,5 +1,3 @@
using System;
namespace Ink_Canvas.Plugins
{
public class PluginInfo