Skip to content

Commit 4d6924e

Browse files
committed
Remove redundant codes
1 parent 3457f30 commit 4d6924e

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

CollapseLauncher/Classes/Helper/WindowUtility.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Hi3Helper.SentryHelper;
66
using Hi3Helper.Shared.Region;
77
using Hi3Helper.Win32.FileDialogCOM;
8-
using Hi3Helper.Win32.ManagedTools;
98
using Hi3Helper.Win32.Native.Enums;
109
using Hi3Helper.Win32.Native.LibraryImport;
1110
using Hi3Helper.Win32.Native.ManagedTools;
@@ -599,9 +598,6 @@ private static IntPtr MainWndProc(IntPtr hwnd, uint msg, UIntPtr wParam, IntPtr
599598
// Return FALSE (0) to prevent shutdown if critical operation is in progress
600599
if (MainWindow.IsCriticalOpInProgress)
601600
{
602-
// Display reason using ShutdownBlocker
603-
ShutdownBlocker.StartBlocking(CurrentWindowPtr, Locale.Lang._Dialogs.EnsureExitSubtitle,
604-
ILoggerHelper.GetILogger("ShutdownBlocker"));
605601
return 0;
606602
}
607603
// Let Windows continue shutdown if no critical operation

CollapseLauncher/Program.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
using Hi3Helper.Http.Legacy;
77
using Hi3Helper.SentryHelper;
88
using Hi3Helper.Shared.ClassStruct;
9-
using Hi3Helper.Win32.ManagedTools;
109
using Hi3Helper.Win32.Native.LibraryImport;
1110
using Hi3Helper.Win32.Native.ManagedTools;
1211
using InnoSetupHelper;
1312
using Microsoft.UI.Dispatching;
1413
using Microsoft.UI.Xaml;
15-
using Microsoft.Win32;
1614
using System;
1715
using System.Diagnostics;
1816
using System.Globalization;
@@ -27,7 +25,6 @@
2725
using WinRT;
2826
using static CollapseLauncher.ArgumentParser;
2927
using static CollapseLauncher.InnerLauncherConfig;
30-
using static CollapseLauncher.MainWindow;
3128
using static Hi3Helper.Locale;
3229
using static Hi3Helper.Logger;
3330
using static Hi3Helper.Shared.Region.LauncherConfig;
@@ -204,8 +201,6 @@ public static void Main(params string[] args)
204201
MainEntryPointExtension.XamlCheckProcessRequirements();
205202
ComWrappersSupport.InitializeComWrappers();
206203

207-
SystemEvents.SessionEnding += SystemEvent_EndingSession;
208-
209204
StartMainApplication();
210205
}
211206
#if !DEBUG
@@ -234,15 +229,6 @@ private static async Task InitDatabaseHandler()
234229
await DbHandler.Init();
235230
}
236231

237-
public static void SystemEvent_EndingSession(object sender, SessionEndingEventArgs e)
238-
{
239-
if (!IsCriticalOpInProgress) return;
240-
241-
e.Cancel = true;
242-
ShutdownBlocker.StartBlocking(WindowUtility.CurrentWindowPtr, Lang._Dialogs.EnsureExitSubtitle,
243-
ILoggerHelper.GetILogger("ShutdownBlocker"));
244-
}
245-
246232
private static void InnoSetupLogUpdate_LoggerEvent(object sender, InnoSetupLogStruct e)
247233
{
248234
LogWriteLine(

CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ public async Task CloseApp()
294294

295295
GamePropertyVault.SafeDisposeVaults();
296296
SentryHelper.StopSentrySdk();
297-
SystemEvents.SessionEnding -= MainEntryPoint.SystemEvent_EndingSession;
298297
_TrayIcon?.Dispose();
299298
Close();
300299
Application.Current.Exit();

0 commit comments

Comments
 (0)