Menu

[r1586]: / trunk / GoogleContactsSync / AboutBox.cs  Maximize  Restore  History

Download this file

89 lines (78 with data), 3.3 kB

 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
using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
namespace GoContactSyncMod
{
internal partial class AboutBox : Form
{
public AboutBox()
{
/* Cannot set Font in designer as there is automatic sorting and Font will be set after AutoScaleDimensions
* This will prevent application to work correctly with high DPI systems. */
Font = new Font("Verdana", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0);
InitializeComponent();
Text = $"About {AssemblyTitle}";
labelProductName.Text = AssemblyProduct;
labelVersion.Text = $"Version {AssemblyVersion}";
labelCopyright.Text = AssemblyCopyright;
labelCompanyName.Text = AssemblyCompany;
textBoxDescription.Text = AssemblyDescription;
}
#region Assembly Attribute Accessors
public static string AssemblyTitle
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (!string.IsNullOrEmpty(titleAttribute.Title))
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public static string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
public static string AssemblyDescription
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public static string AssemblyProduct
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public static string AssemblyCopyright
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public static string AssemblyCompany
{
get
{
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
private void OkButton_Click(object sender, EventArgs e)
{
Close();
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.