refactor: 新Config结构修改

部分迁移自 #12315
This commit is contained in:
status102
2025-07-11 09:09:07 +08:00
parent d8515b15a2
commit f4b71bd0be
14 changed files with 21 additions and 16 deletions

View File

@@ -23,13 +23,15 @@ using System.Text.Json.Serialization;
using System.Text.Unicode;
using System.Threading;
using System.Threading.Tasks;
using MaaWpfGui.Configuration.Global;
using MaaWpfGui.Configuration.Single;
using MaaWpfGui.Helper;
using ObservableCollections;
using Serilog;
[assembly: PropertyChanged.FilterType("MaaWpfGui.Configuration.")]
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Factory
{
public static class ConfigFactory
{
@@ -387,8 +389,8 @@ namespace MaaWpfGui.Configuration
{
get
{
List<string> lists = new List<string>(Root.Configurations.Count);
using IEnumerator<KeyValuePair<string, SpecificConfig>> enumerator = Root.Configurations.GetEnumerator();
var lists = new List<string>(Root.Configurations.Count);
using var enumerator = Root.Configurations.GetEnumerator();
while (enumerator.MoveNext())
{
lists.Add(enumerator.Current.Key);

View File

@@ -14,7 +14,7 @@
#nullable enable
using System.ComponentModel;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Factory
{
// https://github.com/dotnet/runtime/issues/27252
public class PropertyChangedEventDetailArgs : PropertyChangedEventArgs

View File

@@ -13,7 +13,7 @@
using System.ComponentModel;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Global
{
public class AnnouncementInfo : INotifyPropertyChanged
{

View File

@@ -15,7 +15,7 @@ using System.ComponentModel;
using MaaWpfGui.Helper;
using MaaWpfGui.Models;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Global
{
public class GUI : INotifyPropertyChanged
{

View File

@@ -12,8 +12,9 @@
// </copyright>
using System.Text.Json.Serialization;
using MaaWpfGui.Configuration.Factory;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Global
{
public class Timer
{

View File

@@ -14,7 +14,7 @@
#nullable enable
using System.ComponentModel;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Global
{
public class VersionUpdate : INotifyPropertyChanged
{

View File

@@ -14,6 +14,8 @@
#nullable enable
using System.ComponentModel;
using System.Text.Json.Serialization;
using MaaWpfGui.Configuration.Global;
using MaaWpfGui.Configuration.Single;
using ObservableCollections;
namespace MaaWpfGui.Configuration

View File

@@ -14,7 +14,7 @@
using System.Text.Json.Serialization;
using ObservableCollections;
namespace MaaWpfGui.Configuration
namespace MaaWpfGui.Configuration.Single
{
public class SpecificConfig
{

View File

@@ -24,7 +24,7 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Interop;
using HandyControl.Controls;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Helper.Notification;
using MaaWpfGui.WineCompat;
using Microsoft.Win32;

View File

@@ -27,7 +27,7 @@ using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
using GlobalHotKey;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Properties;

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Helper;
using Windows.Win32;

View File

@@ -19,7 +19,7 @@ using System.Threading.Tasks;
using System.Windows.Input;
using HandyControl.Controls;
using HandyControl.Tools.Command;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using Serilog;

View File

@@ -16,14 +16,14 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;
using MaaWpfGui.Utilities.ValueType;
using MaaWpfGui.ViewModels.UI;
using Stylet;
using DarkModeType = MaaWpfGui.Configuration.GUI.DarkModeType;
using DarkModeType = MaaWpfGui.Configuration.Global.GUI.DarkModeType;
namespace MaaWpfGui.ViewModels.UserControl.Settings;

View File

@@ -20,7 +20,7 @@ using System.Linq;
using System.Windows;
using HandyControl.Controls;
using HandyControl.Data;
using MaaWpfGui.Configuration;
using MaaWpfGui.Configuration.Factory;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;