mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 05:12:09 +08:00
1.1.3 -> 1.1.4 第81次更新
This commit is contained in:
parent
aa5765d168
commit
e962850d05
@ -91,7 +91,15 @@ public partial class MainWin : Window
|
|||||||
UpdateUpstreamHostButton_Click(null!, null!);
|
UpdateUpstreamHostButton_Click(null!, null!);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private void MainWin_Closing(object sender, CancelEventArgs e) => Application.Current.Shutdown();
|
private void MainWin_Closing(object sender, CancelEventArgs e)
|
||||||
|
{
|
||||||
|
if (MainPres.IsNginxIniting)
|
||||||
|
File.WriteAllText(MainConst.NginxConfPath, ExtraNginxConfs);
|
||||||
|
if (MainPres.IsMihomoIniting)
|
||||||
|
File.WriteAllText(MainConst.MihomoConfPath, ExtraMihomoConfs);
|
||||||
|
|
||||||
|
Application.Current.Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
private void MainWin_DragEnter(object sender, DragEventArgs e)
|
private void MainWin_DragEnter(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
@ -263,6 +271,8 @@ public partial class MainWin : Window
|
|||||||
File.AppendAllText(MainConst.HostsConfPath, hostsConfAppendContent);
|
File.AppendAllText(MainConst.HostsConfPath, hostsConfAppendContent);
|
||||||
#endregion Child Cert & Hosts
|
#endregion Child Cert & Hosts
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
MainPres.IsNginxIniting = true;
|
MainPres.IsNginxIniting = true;
|
||||||
NginxConfWatcher.EnableRaisingEvents = false;
|
NginxConfWatcher.EnableRaisingEvents = false;
|
||||||
NginxConfs!.Save(MainConst.NginxConfPath);
|
NginxConfs!.Save(MainConst.NginxConfPath);
|
||||||
@ -294,11 +304,14 @@ public partial class MainWin : Window
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
File.WriteAllText(MainConst.NginxConfPath, ExtraNginxConfs);
|
File.WriteAllText(MainConst.NginxConfPath, ExtraNginxConfs);
|
||||||
NginxConfWatcher.EnableRaisingEvents = true;
|
NginxConfWatcher.EnableRaisingEvents = true;
|
||||||
MainPres.IsNginxIniting = false;
|
MainPres.IsNginxIniting = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (Process nginxProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.NginxPath)))
|
foreach (Process nginxProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.NginxPath)))
|
||||||
@ -339,6 +352,8 @@ public partial class MainWin : Window
|
|||||||
if (!File.Exists(MainConst.MihomoConfPath))
|
if (!File.Exists(MainConst.MihomoConfPath))
|
||||||
File.Create(MainConst.MihomoConfPath).Dispose();
|
File.Create(MainConst.MihomoConfPath).Dispose();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
MainPres.IsMihomoIniting = true;
|
MainPres.IsMihomoIniting = true;
|
||||||
MihomoConfWatcher.EnableRaisingEvents = false;
|
MihomoConfWatcher.EnableRaisingEvents = false;
|
||||||
File.WriteAllText(MainConst.MihomoConfPath, MihomoConfs);
|
File.WriteAllText(MainConst.MihomoConfPath, MihomoConfs);
|
||||||
@ -369,11 +384,14 @@ public partial class MainWin : Window
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
File.WriteAllText(MainConst.MihomoConfPath, ExtraMihomoConfs);
|
File.WriteAllText(MainConst.MihomoConfPath, ExtraMihomoConfs);
|
||||||
MihomoConfWatcher.EnableRaisingEvents = true;
|
MihomoConfWatcher.EnableRaisingEvents = true;
|
||||||
MainPres.IsMihomoIniting = false;
|
MainPres.IsMihomoIniting = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (Process mihomoProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath)))
|
foreach (Process mihomoProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath)))
|
||||||
|
Loading…
Reference in New Issue
Block a user