-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAboutBox.cs
77 lines (70 loc) · 2.56 KB
/
AboutBox.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
/*
Maneubo is an application that provides a virtual maneuvering board and target
motion analysis.
http://www.adammil.net/Maneubo
Copyright (C) 2011-2020 Adam Milazzo
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Globalization;
using System.Reflection;
using System.Windows.Forms;
using System.Diagnostics;
namespace Maneubo
{
partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyTitle + ", version " + AssemblyVersion;
this.labelCopyright.Text = AssemblyCopyright;
}
#region Assembly Attribute Accessors
string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if(attributes.Length != 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if(!string.IsNullOrEmpty(titleAttribute.Title)) return titleAttribute.Title;
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
string AssemblyVersion
{
get
{
Version version = Assembly.GetExecutingAssembly().GetName().Version;
return string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}", version.Major, version.Minor, version.Build);
}
}
#endregion
void lblUrl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(lblUrl.Text);
}
}
}