annotate ServerMonitor/Forms/AboutForm.cs @ 19:b3128fe10d57

Add About form and license.
author Brad Greco <brad@bgreco.net>
date Wed, 29 May 2019 20:18:37 -0400
parents
children b21318f6e3f1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
1 using ServerMonitorApp.Properties;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
2 using System;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
3 using System.Diagnostics;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
4 using System.Reflection;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
5 using System.Windows.Forms;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
6
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
7 namespace ServerMonitorApp
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
8 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
9 /// <summary>Program About form.</summary>
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
10 public partial class AboutForm : Form
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
11 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
12 public AboutForm()
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
13 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
14 InitializeComponent();
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
15 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
16
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
17 private void AboutForm_Load(object sender, EventArgs e)
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
18 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
19 Icon = Resources.icon;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
20 NameLabel.Text += " " + Assembly.GetExecutingAssembly().GetName().Version.ToString(2);
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
21 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
22
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
23 /// <summary>Hides the form when ESC is pressed.</summary>
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
24 protected override bool ProcessDialogKey(Keys keyData)
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
25 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
26 if (keyData == Keys.Escape)
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
27 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
28 Close();
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
29 return true;
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
30 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
31 return base.ProcessDialogKey(keyData);
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
32 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
33
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
34 private void HomePageLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
35 {
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
36 Process.Start("http://bgreco.net/servermonitor");
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
37 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
38 }
b3128fe10d57 Add About form and license.
Brad Greco <brad@bgreco.net>
parents:
diff changeset
39 }