-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowAbout.cs
62 lines (54 loc) · 1.89 KB
/
WindowAbout.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
using System.Reflection;
namespace Kneeboard_Picture_Viewer
{
partial class WindowAbout : Form
{
public WindowAbout()
{
InitializeComponent();
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = "v1.0.2";
this.labelCopyright.Text = AssemblyCopyright;
Assembly assembly = Assembly.GetExecutingAssembly();
string resFileName = "Kneeboard_Picture_Viewer.Resources.readme.rtf";
using (Stream creditStream = assembly.GetManifestResourceStream(resFileName))
{
this.richTextBox.LoadFile(creditStream, RichTextBoxStreamType.RichText);
}
}
#region Assembly Attribute Accessors
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
#endregion
private void okButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void richTextBox_LinkClicked(object sender, LinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("explorer.exe", e.LinkText);
}
}
}