00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Drawing;
00005 using System.Linq;
00006 using System.Reflection;
00007 using System.Windows.Forms;
00008
00009 namespace UtmConvert {
00010 partial class AboutBoxMainForm : Form {
00011 public AboutBoxMainForm() {
00012 InitializeComponent();
00013 this.Text = String.Format("About {0} {0}", AssemblyTitle);
00014 this.labelProductName.Text = AssemblyProduct;
00015 this.labelVersion.Text = String.Format("Version {0} {0}", AssemblyVersion);
00016 this.labelCopyright.Text = AssemblyCopyright;
00017 this.labelCompanyName.Text = AssemblyCompany;
00018 this.textBoxDescription.Text = AssemblyDescription;
00019 }
00020
00021 #region Assembly Attribute Accessors
00022
00023 public string AssemblyTitle {
00024 get {
00025 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
00026 if (attributes.Length > 0) {
00027 AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
00028 if (titleAttribute.Title != "") {
00029 return titleAttribute.Title;
00030 }
00031 }
00032 return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
00033 }
00034 }
00035
00036 public string AssemblyVersion {
00037 get {
00038 return Assembly.GetExecutingAssembly().GetName().Version.ToString();
00039 }
00040 }
00041
00042 public string AssemblyDescription {
00043 get {
00044 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
00045 if (attributes.Length == 0) {
00046 return "";
00047 }
00048 return ((AssemblyDescriptionAttribute)attributes[0]).Description;
00049 }
00050 }
00051
00052 public string AssemblyProduct {
00053 get {
00054 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
00055 if (attributes.Length == 0) {
00056 return "";
00057 }
00058 return ((AssemblyProductAttribute)attributes[0]).Product;
00059 }
00060 }
00061
00062 public string AssemblyCopyright {
00063 get {
00064 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
00065 if (attributes.Length == 0) {
00066 return "";
00067 }
00068 return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
00069 }
00070 }
00071
00072 public string AssemblyCompany {
00073 get {
00074 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
00075 if (attributes.Length == 0) {
00076 return "";
00077 }
00078 return ((AssemblyCompanyAttribute)attributes[0]).Company;
00079 }
00080 }
00081 #endregion
00082
00083 private void okButton_Click(object sender, EventArgs e) {
00084 this.Dispose();
00085 }
00086 }
00087 }