From 592f871778e05ef7817cf57bedc28fd51173e661 Mon Sep 17 00:00:00 2001 From: Space Time Date: Thu, 26 Dec 2024 12:46:20 +0800 Subject: [PATCH] =?UTF-8?q?1.1.4=20->=201.1.5=20=E7=AC=AC5=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Proces/BrowserProc.cs | 2 +- Wins/MainWin.xaml.cs | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Proces/BrowserProc.cs b/Proces/BrowserProc.cs index d635d3b..692427d 100644 --- a/Proces/BrowserProc.cs +++ b/Proces/BrowserProc.cs @@ -12,7 +12,7 @@ internal class BrowserProc : Proc { ShutDownAppOnProcessExit = shutDownAppOnProcessExit; - Process_Exited(null!, null!); + Process_Exited(null!, EventArgs.Empty); } protected sealed override void Process_Exited(object? sender, EventArgs e) diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index f42d527..6e971a0 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -83,15 +83,15 @@ public partial class MainWin : Window foreach (string cealHostPath in Directory.GetFiles(CealHostWatcher.Path, CealHostWatcher.Filter)) CealHostWatcher_Changed(null!, new(new(), Path.GetDirectoryName(cealHostPath)!, Path.GetFileName(cealHostPath))); - MihomoConfWatcher_Changed(null!, null!); + MihomoConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); if (!MainPres.IsNginxRunning) await NginxCleaner.Clean(); if (Array.Exists(Environment.GetCommandLineArgs(), arg => arg.Equals("-s", StringComparison.OrdinalIgnoreCase))) - LaunchButton_Click(null, null!); + LaunchButton_Click(null, (RoutedEventArgs)RoutedEventArgs.Empty); - UpdateUpstreamHostButton_Click(null, null!); + UpdateUpstreamHostButton_Click(null, (RoutedEventArgs)RoutedEventArgs.Empty); }); } private async void MainWin_Closing(object sender, CancelEventArgs e) @@ -167,11 +167,11 @@ public partial class MainWin : Window Button? senderButton = sender as Button; if (senderButton == NginxButton) - NginxButtonHoldTimer_Tick(null, null!); + NginxButtonHoldTimer_Tick(null, EventArgs.Empty); else if (senderButton == MihomoButton) - MihomoButtonHoldTimer_Tick(null, null!); + MihomoButtonHoldTimer_Tick(null, EventArgs.Empty); else - BrowserButtonHoldTimer_Tick(sender == null, null!); + BrowserButtonHoldTimer_Tick(sender == null, EventArgs.Empty); } private void LaunchButton_PreviewMouseDown(object sender, MouseButtonEventArgs e) { @@ -329,7 +329,7 @@ public partial class MainWin : Window { await NginxCleaner.Clean(); - NginxConfWatcher_Changed(null!, null!); + NginxConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); }; nginxProcess.Kill(); @@ -392,7 +392,7 @@ public partial class MainWin : Window else foreach (Process mihomoProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath))) { - mihomoProcess.Exited += (_, _) => MihomoConfWatcher_Changed(null!, null!); + mihomoProcess.Exited += (_, _) => MihomoConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); mihomoProcess.Kill(); } @@ -500,7 +500,7 @@ public partial class MainWin : Window { MessageBox.Show(MainConst._GameStartMsg); MainPres.IsFlashing = true; - NginxConfWatcher_Changed(null!, null!); + NginxConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); Random random = new(); @@ -536,7 +536,7 @@ public partial class MainWin : Window } MainPres.IsFlashing = false; - NginxConfWatcher_Changed(null!, null!); + NginxConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); MessageBox.Show(MainConst._GameEndingMsg); } else @@ -632,7 +632,7 @@ public partial class MainWin : Window CealArgs = @$"--host-rules=""{hostRules.TrimEnd(',')}"" --host-resolver-rules=""{hostResolverRules.TrimEnd(',')}"" --test-type --ignore-certificate-errors"; - NginxConfWatcher_Changed(null!, null!); + NginxConfWatcher_Changed(null!, (FileSystemEventArgs)FileSystemEventArgs.Empty); } } private async void NginxConfWatcher_Changed(object sender, FileSystemEventArgs e)