Skip to content

Commit

Permalink
Credits & Exit
Browse files Browse the repository at this point in the history
  • Loading branch information
mili-tan committed Jan 14, 2019
1 parent 6ec343d commit 58a24e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
12 changes: 8 additions & 4 deletions AuroraGUI/AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ public AboutWindow()
VerText.Text += $" ({File.GetLastWriteTime(GetType().Assembly.Location)})";
}

private void ButtonCredits_OnClick(object sender, RoutedEventArgs e)
=> Process.Start($"https://github.com/mili-tan/AuroraDNS.GUI/raw/master/CREDITS");
private void ButtonCredits_OnClick(object sender, RoutedEventArgs e)
{
Process.Start(File.Exists(MainWindow.SetupBasePath + "CREDITS.html")
? $"file://{MainWindow.SetupBasePath}CREDITS.html"
: "https://github.com/mili-tan/AuroraDNS.GUI/blob/master/CREDITS.md");
}

private void ButtonAbout_OnClick(object sender, RoutedEventArgs e)
=> Process.Start($"https://dns.mili.one");
=> Process.Start("https://dns.mili.one");

private void Hyperlink_OnClick(object sender, RoutedEventArgs e)
=> Process.Start($"https://milione.cc/?page_id=880");
=> Process.Start("https://milione.cc/?page_id=880");
}
}
2 changes: 1 addition & 1 deletion AuroraGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
DockPanel.Dock="Right" HorizontalAlignment="Right" Checked="DnsEnable_Checked" Unchecked="DnsEnable_Unchecked" />
</DockPanel>
</materialDesign:ColorZone>
<Grid Margin="47,67,47,57" Grid.ColumnSpan="2" Grid.Column="0" Opacity="0.95">
<Grid Name="ControlGrid" Margin="47,67,47,57" Grid.ColumnSpan="2" Grid.Column="0" Opacity="0.95">

<ToggleButton x:Name="IsSysDns"
Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
Expand Down
18 changes: 12 additions & 6 deletions AuroraGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public MainWindow()
ServicePointManager.ServerCertificateValidationCallback +=
(sender, cert, chain, sslPolicyErrors) => true;

switch (1.2F)
switch (1.2)
{
case 1:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
break;
case 1.1F:
case 1.1:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
break;
case 1.2F:
case 1.2:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
break;
default:
Expand Down Expand Up @@ -143,17 +143,23 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
Snackbar.IsActive = true;
if (Process.GetProcessesByName(System.Windows.Forms.Application.CompanyName).Length > 1)
{
Snackbar.Message = new SnackbarMessage() {Content = "DNS 服务器无法启动:端口被占用"};
Snackbar.Message = new SnackbarMessage() {Content = "DNS 服务器无法启动, 端口被占用"};
NotifyIcon.Text = @"AuroraDNS - [端口被占用]";
}
else
{
Snackbar.Message = new SnackbarMessage() { Content = "DNS 服务器无法启动:可能已有一个实例正在运行, 请不要重复启动" };
var snackbarMsg = new SnackbarMessage()
{
Content = "可能已有一个正在运行的实例, 请不要重复启动!",
ActionContent = "退出",
};
snackbarMsg.ActionClick += (o, args) => Environment.Exit(Environment.ExitCode);
Snackbar.Message = snackbarMsg;
NotifyIcon.Text = @"AuroraDNS - [请不要重复启动]";
}

DnsEnable.IsEnabled = false;
IsEnabled = false;
ControlGrid.IsEnabled = false;

}

Expand Down

0 comments on commit 58a24e2

Please sign in to comment.