-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutDialog.cs
83 lines (64 loc) · 2.1 KB
/
AboutDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
namespace LangontsAntSimulator
{
public partial class AboutDialog : BaseForm
{
#region Public Constructors
public AboutDialog()
{
InitializeComponent();
}
#endregion Public Constructors
#region Protected Overridden Methods
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Assembly assembly;
FileVersionInfo versionInfo;
assembly = typeof(Program).Assembly;
versionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
productNameLabel.Text = versionInfo.ProductName;
productVersionLabel.Text = string.Format("Version {0}", versionInfo.FileVersion);
copyrightLabel.Text = versionInfo.LegalCopyright;
this.Text = string.Format(this.Text, versionInfo.ProductName);
productNameLabel.Font = new Font(this.Font, FontStyle.Bold);
productVersionLabel.Font = new Font(this.Font, FontStyle.Bold);
}
#endregion Protected Overridden Methods
#region Event Handlers
private void antLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.RunUrl("http://www.iconarchive.com/show/animal-icons-by-martin-berube/ant-icon.html");
}
private void closeButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void cyotekLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.RunUrl("http://cyotek.com");
}
private void iconsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.RunUrl("http://p.yusukekamiyamane.com/");
}
#endregion Event Handlers
#region Private Methods
private void RunUrl(string url)
{
try
{
Process.Start(url);
}
catch (Exception)
{
MessageBox.Show(string.Format("Fail to start '{0}'", url), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
#endregion Private Methods
}
}