Rename Manager
This commit is contained in:
@@ -26,7 +26,7 @@ public partial class App : Application
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
AppHandler.Instance.InitComponents();
|
||||
AppManager.Instance.InitComponents();
|
||||
|
||||
desktop.Exit += OnExit;
|
||||
desktop.MainWindow = new MainWindow();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
||||
{
|
||||
try
|
||||
{
|
||||
var sizeItem = ConfigHandler.GetWindowSizeItem(AppHandler.Instance.Config, GetType().Name);
|
||||
var sizeItem = ConfigHandler.GetWindowSizeItem(AppManager.Instance.Config, GetType().Name);
|
||||
if (sizeItem == null)
|
||||
{
|
||||
return;
|
||||
@@ -46,7 +46,7 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
||||
base.OnClosed(e);
|
||||
try
|
||||
{
|
||||
ConfigHandler.SaveWindowSizeItem(AppHandler.Instance.Config, GetType().Name, Width, Height);
|
||||
ConfigHandler.SaveWindowSizeItem(AppManager.Instance.Config, GetType().Name, Width, Height);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ internal class Program
|
||||
}
|
||||
}
|
||||
|
||||
if (!AppHandler.Instance.InitApp())
|
||||
if (!AppManager.Instance.InitApp())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -63,6 +63,6 @@ internal class Program
|
||||
.WithFontByDefault()
|
||||
.LogToTrace()
|
||||
.UseReactiveUI()
|
||||
.With(new MacOSPlatformOptions { ShowInDock = AppHandler.Instance.Config.UiItem.MacOSShowInDock });
|
||||
.With(new MacOSPlatformOptions { ShowInDock = AppManager.Instance.Config.UiItem.MacOSShowInDock });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ThemeSettingViewModel : MyReactiveObject
|
||||
|
||||
public ThemeSettingViewModel()
|
||||
{
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
|
||||
BindingUI();
|
||||
RestoreUI();
|
||||
@@ -75,7 +75,7 @@ public class ThemeSettingViewModel : MyReactiveObject
|
||||
_config.UiItem.CurrentLanguage = CurrentLanguage;
|
||||
Thread.CurrentThread.CurrentUICulture = new(CurrentLanguage);
|
||||
ConfigHandler.SaveConfig(_config);
|
||||
NoticeHandler.Instance.Enqueue(ResUI.NeedRebootTips);
|
||||
NoticeManager.Instance.Enqueue(ResUI.NeedRebootTips);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
||||
|
||||
case EConfigType.Shadowsocks:
|
||||
gridSs.IsVisible = true;
|
||||
cmbSecurity3.ItemsSource = AppHandler.Instance.GetShadowsocksSecurities(profileItem);
|
||||
cmbSecurity3.ItemsSource = AppManager.Instance.GetShadowsocksSecurities(profileItem);
|
||||
break;
|
||||
|
||||
case EConfigType.SOCKS:
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class DNSSettingWindow : WindowBase<DNSSettingViewModel>
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
btnCancel.Click += (s, e) => this.Close();
|
||||
ViewModel = new DNSSettingViewModel(UpdateViewHandler);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public partial class FullConfigTemplateWindow : WindowBase<FullConfigTemplateVie
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
btnCancel.Click += (s, e) => this.Close();
|
||||
ViewModel = new FullConfigTemplateViewModel(UpdateViewHandler);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
_manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.TopRight };
|
||||
|
||||
this.KeyDown += MainWindow_KeyDown;
|
||||
@@ -352,7 +352,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||
{
|
||||
//ShowHideWindow(false);
|
||||
|
||||
NoticeHandler.Instance.SendMessageAndEnqueue("Not yet implemented.(还未实现)");
|
||||
NoticeManager.Instance.SendMessageAndEnqueue("Not yet implemented.(还未实现)");
|
||||
await Task.CompletedTask;
|
||||
//if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
//{
|
||||
@@ -478,7 +478,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||
|
||||
private void AddHelpMenuItem()
|
||||
{
|
||||
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo();
|
||||
var coreInfo = CoreInfoManager.Instance.GetCoreInfo();
|
||||
foreach (var it in coreInfo
|
||||
.Where(t => t.CoreType != ECoreType.v2fly
|
||||
&& t.CoreType != ECoreType.hysteria))
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
||||
InitializeComponent();
|
||||
|
||||
btnCancel.Click += (s, e) => this.Close();
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
|
||||
ViewModel = new OptionSettingViewModel(UpdateViewHandler);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
_window = window;
|
||||
|
||||
menuSelectAll.Click += menuSelectAll_Click;
|
||||
|
||||
@@ -20,7 +20,7 @@ public partial class StatusBarView : ReactiveUserControl<StatusBarViewModel>
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_config = AppHandler.Instance.Config;
|
||||
_config = AppManager.Instance.Config;
|
||||
//ViewModel = new StatusBarViewModel(UpdateViewHandler);
|
||||
//Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(StatusBarViewModel));
|
||||
ViewModel = Locator.Current.GetService<StatusBarViewModel>();
|
||||
@@ -113,7 +113,7 @@ public partial class StatusBarView : ReactiveUserControl<StatusBarViewModel>
|
||||
return false;
|
||||
}
|
||||
|
||||
AppHandler.Instance.LinuxSudoPwd = password;
|
||||
AppManager.Instance.LinuxSudoPwd = password;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public partial class SudoPasswordInputView : UserControl
|
||||
else
|
||||
{
|
||||
// Password verification failed, display error and let user try again
|
||||
NoticeHandler.Instance.Enqueue(ResUI.SudoIncorrectPasswordTip);
|
||||
NoticeManager.Instance.Enqueue(ResUI.SudoIncorrectPasswordTip);
|
||||
txtPassword.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user