1.1.3 -> 1.1.4 第92次更新

This commit is contained in:
Space Time 2024-12-20 21:18:57 +08:00
parent 64f4bbad02
commit 1a08c65c0d
2 changed files with 20 additions and 1 deletions

View File

@ -40,6 +40,8 @@ internal abstract partial class MainConst : MainMultilangConst
internal static string MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml"); internal static string MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml");
internal static string[] MihomoNameServers => ["https://doh.apad.pro/dns-query", "https://ns.net.kg/dns-query"]; internal static string[] MihomoNameServers => ["https://doh.apad.pro/dns-query", "https://ns.net.kg/dns-query"];
internal static string NotifyIconText => "Sheas Cealer";
[GeneratedRegex(@"^(https?:\/\/)?[a-zA-Z0-9](-*[a-zA-Z0-9])*(\.[a-zA-Z0-9](-*[a-zA-Z0-9])*)*(:\d{1,5})?(\/[a-zA-Z0-9.\-_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%]*)*$")] [GeneratedRegex(@"^(https?:\/\/)?[a-zA-Z0-9](-*[a-zA-Z0-9])*(\.[a-zA-Z0-9](-*[a-zA-Z0-9])*)*(:\d{1,5})?(\/[a-zA-Z0-9.\-_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%]*)*$")]
internal static partial Regex UpstreamUrlRegex(); internal static partial Regex UpstreamUrlRegex();

View File

@ -15,6 +15,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Net.Sockets; using System.Net.Sockets;
using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
@ -760,7 +761,23 @@ public partial class MainWin : Window
} }
private void MainWin_KeyDown(object sender, KeyEventArgs e) private void MainWin_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.W) if (e.KeyboardDevice.Modifiers != ModifierKeys.Control)
return;
if (e.Key == Key.W)
Application.Current.Shutdown(); Application.Current.Shutdown();
else if (e.Key == Key.H)
{
System.Windows.Forms.NotifyIcon notifyIcon = new() { Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location), Text = MainConst.NotifyIconText, Visible = true };
notifyIcon.Click += (_, _) =>
{
Show();
notifyIcon.Dispose();
};
Hide();
}
} }
} }