2 using System.Collections.Generic;
3 using System.ComponentModel;
5 using System.Windows.Forms;
6 using System.Reflection;
8 namespace Sample_Environment_Control_Interface.Dialogs.Help
14 InitializeComponent();
20 this.Text = String.Format(
"About {0}", AssemblyTitle.Replace(
'_',
' '));
21 this.labelProductName.Text = AssemblyProduct.Replace(
'_',
' ');
22 this.labelVersion.Text = String.Format(
"Version {0}", AssemblyVersion);
23 this.labelCopyright.Text = AssemblyCopyright;
24 this.labelCompanyName.Text = AssemblyCompany;
25 this.textBoxDescription.Text = AssemblyDescription;
28 #region Assembly Attribute Accessors
30 public string AssemblyTitle
35 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute),
false);
37 if (attributes.Length > 0)
40 AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
42 if (titleAttribute.Title !=
"")
43 return titleAttribute.Title;
46 return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
50 public string AssemblyVersion
54 return Assembly.GetExecutingAssembly().GetName().Version.ToString();
58 public string AssemblyDescription
63 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute),
false);
65 if (attributes.Length == 0)
68 return ((AssemblyDescriptionAttribute)attributes[0]).Description;
72 public string AssemblyProduct
77 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute),
false);
79 if (attributes.Length == 0)
82 return ((AssemblyProductAttribute)attributes[0]).Product;
86 public string AssemblyCopyright
91 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute),
false);
93 if (attributes.Length == 0)
96 return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
100 public string AssemblyCompany
105 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute),
false);
107 if (attributes.Length == 0)
110 return ((AssemblyCompanyAttribute)attributes[0]).Company;