Skip to content

Commit

Permalink
Update the Project
Browse files Browse the repository at this point in the history
  • Loading branch information
racpast committed Dec 22, 2024
1 parent 90baa8e commit fe8c748
Show file tree
Hide file tree
Showing 67 changed files with 17,819 additions and 2,101 deletions.
3 changes: 2 additions & 1 deletion App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SNIBypassGUI"
StartupUri="MainWindow.xaml">
StartupUri="MainWindow.xaml"
SessionEnding="Application_SessionEnding">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
12 changes: 11 additions & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Windows;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace SNIBypassGUI
{
Expand All @@ -7,5 +9,13 @@ namespace SNIBypassGUI
/// </summary>
public partial class App : Application
{
private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e)
{
// 你们不要直接关机啦,SessionEnding 也有不行的时候 (╥﹏╥)
var _mainWindow = Current.Windows
.Cast<Window>()
.FirstOrDefault(window => window is MainWindow) as MainWindow;
_mainWindow.ExitBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
}
}
}
Loading

0 comments on commit fe8c748

Please sign in to comment.