forked from KeeTrayTOTP/KeeTrayTOTP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormAbout.cs
157 lines (145 loc) · 4.98 KB
/
FormAbout.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
using System;
using System.Reflection;
using System.Windows.Forms;
using KeePass.Plugins;
namespace KeeTrayTOTP
{
/// <summary>
/// Form providing information on the plugin.
/// </summary>
internal partial class FormAbout : Form
{
/// <summary>
/// Plugin Host.
/// </summary>
private readonly KeeTrayTOTPExt _plugin;
/// <summary>
/// Windows Form Constructor.
/// </summary>
/// <param name="plugin">Plugin Host.</param>
internal FormAbout(KeeTrayTOTPExt plugin)
{
_plugin = plugin;
InitializeComponent();
}
/// <summary>
/// Windows Form Load.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void FormAbout_Load(object sender, EventArgs e)
{
Text = TrayTOTP_Plugin_Localization.strAbout + TrayTOTP_Plugin_Localization.strSpaceDashSpace + TrayTOTP_Plugin_Localization.strTrayTOTPPlugin;
ListViewAbout.Items[0].SubItems.Add(AssemblyTitle);
ListViewAbout.Items[1].SubItems.Add(AssemblyCompany);
ListViewAbout.Items[2].SubItems.Add(AssemblyVersion);
ListViewAbout.Items[3].SubItems.Add(AssemblyTrademark);
ListViewAbout.Items[4].SubItems.Add(KeeTrayTOTPExt.strEmail);
LabelCopyright.Text = AssemblyCopyright;
}
/// <summary>
/// Gets the assembly's title
/// </summary>
internal string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != string.Empty)
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
/// <summary>
/// Gets the assembly's version
/// </summary>
internal string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
/// <summary>
/// Gets the assembly's description
/// </summary>
internal string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return string.Empty;
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
/// <summary>
/// Gets the assembly's product name
/// </summary>
internal string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return string.Empty;
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
/// <summary>
/// Gets the assembly's copyright
/// </summary>
internal string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return string.Empty;
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
/// <summary>
/// Gets the assembly's trademark
/// </summary>
internal string AssemblyTrademark
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTrademarkAttribute), false);
if (attributes.Length == 0)
{
return string.Empty;
}
return ((AssemblyTrademarkAttribute)attributes[0]).Trademark;
}
}
/// <summary>
/// Gets the assembly's company name
/// </summary>
internal string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return string.Empty;
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
}
}