-
Notifications
You must be signed in to change notification settings - Fork 1
/
About.cs
99 lines (87 loc) · 2.91 KB
/
About.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using Nfu.Properties;
using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
namespace Nfu
{
partial class About : Form
{
/// <summary>
/// Constructor.
/// </summary>
public About()
{
InitializeComponent();
// 22 is the width of the scrollbar
listViewLibraries.Columns[0].Width = listViewLibraries.Width / 3 - 22;
listViewLibraries.Columns[1].Width = listViewLibraries.Width / 3;
listViewLibraries.Columns[2].Width = listViewLibraries.Width / 3;
textBoxVersion.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
var sshNet = new ListViewItem(new[] {
Resources.SshNetName,
Resources.SshNetUrl,
Resources.SshNetUsedFor
});
var iconPack = new ListViewItem(new[] {
Resources.IcoMoonName,
Resources.IcoMoonUrl,
Resources.IcoMoonUsedFor
});
listViewLibraries.Items.AddRange(new[] {
sshNet,
iconPack
});
}
/// <summary>
/// Open the selected library page.
/// </summary>
private void OpenLibraryUrl(object sender, EventArgs e)
{
if (listViewLibraries.SelectedItems.Count > 0)
Process.Start(listViewLibraries.SelectedItems[0].SubItems[1].Text);
}
/// <summary>
/// Open the changelog page.
/// </summary>
private void OpenChangelog(object sender, EventArgs e)
{
Process.Start(Resources.ChangeLogUrl);
}
/// <summary>
/// Open the contributors page.
/// </summary>
private void OpenContributors(object sender, EventArgs e)
{
Process.Start(Resources.ContributorsUrl);
}
/// <summary>
/// Open the issues page.
/// </summary>
private void OpenIssues(object sender, EventArgs e)
{
Process.Start(Resources.IssuesUrl);
}
/// <summary>
/// Open the license page.
/// </summary>
private void OpenLicense(object sender, EventArgs e)
{
Process.Start(Resources.LicenseUrl);
}
/// <summary>
/// Open the NFU log using the Event Viewer with a filter.
/// </summary>
private void OpenNfuLog(object sender, EventArgs e)
{
Process.Start("eventvwr", "/f:\"<QueryList><Query Id='0' Path='Application'><Select Path='Application'>*[System[Provider[@Name='NFU']]]</Select></Query></QueryList>\"");
}
/// <summary>
/// Open the source page.
/// </summary>
private void OpenSource(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(Resources.SourceUrl);
}
}
}