优化代码

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,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;
@@ -495,7 +494,7 @@ namespace Ink_Canvas.Windows.SettingsViews
if (settingsView != null)
{
var pageTag = string.Format("PluginSettings_{0}", plugin.Id);
_pageTypes[pageTag] = typeof(PluginSettingsPage);
_pluginPages[pageTag] = plugin;