Optimize and improve GlobalUsings

This commit is contained in:
2dust 2025-10-19 13:54:40 +08:00
parent b66bfabd21
commit eb1339f2f5
34 changed files with 24 additions and 135 deletions

View file

@ -1,7 +1,3 @@
using System.Diagnostics;
using System.Windows;
using System.Windows.Threading;
namespace v2rayN; namespace v2rayN;
/// <summary> /// <summary>

View file

@ -1,5 +1,3 @@
using System.Windows;
[assembly: ThemeInfo( [assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page, //(used if a resource is not found in the page,
@ -7,4 +5,4 @@ using System.Windows;
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page, //(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries) // app, or any theme specific resource dictionaries)
)] )]

View file

@ -1,6 +1,3 @@
using System.Windows;
using ReactiveUI;
namespace v2rayN.Base; namespace v2rayN.Base;
public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewModel : class public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewModel : class

View file

@ -1,7 +1,4 @@
using System.Collections;
using System.Drawing; using System.Drawing;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;

View file

@ -1,4 +1,3 @@
using System.Windows;
using Microsoft.Win32; using Microsoft.Win32;
namespace v2rayN; namespace v2rayN;

View file

@ -1,7 +1,4 @@
using System.Drawing; using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using Microsoft.Win32; using Microsoft.Win32;

View file

@ -1,4 +1,3 @@
using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
namespace v2rayN.Converters; namespace v2rayN.Converters;

View file

@ -1,6 +1,3 @@
using System.Globalization;
using System.Windows.Data;
namespace v2rayN.Converters; namespace v2rayN.Converters;
[ValueConversion(typeof(bool), typeof(bool))] [ValueConversion(typeof(bool), typeof(bool))]

View file

@ -1,3 +1,26 @@
global using System;
global using System.Collections;
global using System.Collections.Generic;
global using System.ComponentModel;
global using System.Diagnostics;
global using System.Globalization;
global using System.IO;
global using System.Linq;
global using System.Reactive.Disposables;
global using System.Reactive.Linq;
global using System.Runtime.InteropServices;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Windows;
global using System.Windows.Data;
global using System.Windows.Input;
global using System.Windows.Interop;
global using System.Windows.Threading;
global using DynamicData;
global using DynamicData.Binding;
global using ReactiveUI;
global using ReactiveUI.Fody.Helpers;
global using ServiceLib; global using ServiceLib;
global using ServiceLib.Base; global using ServiceLib.Base;
global using ServiceLib.Common; global using ServiceLib.Common;

View file

@ -1,10 +1,3 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
namespace v2rayN.Manager; namespace v2rayN.Manager;
public sealed class HotkeyManager public sealed class HotkeyManager

View file

@ -1,5 +1,4 @@
using System.Drawing; using System.Drawing;
using System.IO;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
namespace v2rayN.Manager; namespace v2rayN.Manager;

View file

@ -1,14 +1,6 @@
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using DynamicData;
using DynamicData.Binding;
using MaterialDesignColors; using MaterialDesignColors;
using MaterialDesignColors.ColorManipulation; using MaterialDesignColors.ColorManipulation;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
namespace v2rayN.ViewModels; namespace v2rayN.ViewModels;

View file

@ -1,9 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Input;
using DynamicData;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class AddGroupServerWindow public partial class AddGroupServerWindow

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class AddServer2Window public partial class AddServer2Window

View file

@ -1,7 +1,4 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class BackupAndRestoreView public partial class BackupAndRestoreView

View file

@ -1,6 +1,3 @@
using System.Reactive.Disposables;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class CheckUpdateView public partial class CheckUpdateView

View file

@ -1,7 +1,4 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows.Input;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
/// <summary> /// <summary>

View file

@ -1,8 +1,3 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class DNSSettingWindow public partial class DNSSettingWindow

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class FullConfigTemplateWindow public partial class FullConfigTemplateWindow

View file

@ -1,9 +1,4 @@
using System.Reactive.Disposables;
using System.Text;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input;
using ReactiveUI;
using v2rayN.Manager; using v2rayN.Manager;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,13 +1,6 @@
using System.ComponentModel;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media; using System.Windows.Media;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using ReactiveUI;
using v2rayN.Manager; using v2rayN.Manager;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,8 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Threading;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class MsgView public partial class MsgView

View file

@ -1,9 +1,4 @@
using System.Globalization;
using System.IO;
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,9 +1,5 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Input;
using ReactiveUI;
using v2rayN.Base; using v2rayN.Base;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,13 +1,7 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using ReactiveUI;
using v2rayN.Base; using v2rayN.Base;
using Point = System.Windows.Point; using Point = System.Windows.Point;

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class RoutingRuleDetailsWindow public partial class RoutingRuleDetailsWindow

View file

@ -1,8 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Input;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class RoutingRuleSettingWindow public partial class RoutingRuleSettingWindow

View file

@ -1,8 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Input;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class RoutingSettingWindow public partial class RoutingSettingWindow

View file

@ -1,8 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using ReactiveUI;
using v2rayN.Manager; using v2rayN.Manager;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,7 +1,3 @@
using System.Reactive.Disposables;
using System.Windows;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;
public partial class SubEditWindow public partial class SubEditWindow

View file

@ -1,9 +1,4 @@
using System.ComponentModel;
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Input;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using ReactiveUI;
namespace v2rayN.Views; namespace v2rayN.Views;

View file

@ -1,5 +1,3 @@
using System.Reactive.Disposables;
using ReactiveUI;
using v2rayN.ViewModels; using v2rayN.ViewModels;
namespace v2rayN.Views; namespace v2rayN.Views;