00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Drawing;
00005 using System.Windows.Forms;
00006 using System.Reflection;
00007
00008 namespace Client
00009 {
00013 partial class About : Form
00014 {
00018 public About()
00019 {
00020 InitializeComponent();
00021
00022
00023
00024
00025
00026 this.Text = String.Format("About {0}", AssemblyTitle);
00027 this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
00028 this.labelCopyright.Text = AssemblyCopyright;
00029 this.labelCompanyName.Text = AssemblyCompany;
00030 }
00031
00032 #region Assembly Attribute Accessors
00033
00037 public string AssemblyTitle
00038 {
00039 get
00040 {
00041
00042 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
00043
00044 if (attributes.Length > 0)
00045 {
00046
00047 AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
00048
00049 if (titleAttribute.Title != "")
00050 return titleAttribute.Title;
00051 }
00052
00053 return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
00054 }
00055 }
00056
00060 public string AssemblyVersion
00061 {
00062 get
00063 {
00064 return Assembly.GetExecutingAssembly().GetName().Version.ToString();
00065 }
00066 }
00067
00071 public string AssemblyCopyright
00072 {
00073 get
00074 {
00075
00076 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
00077
00078 if (attributes.Length == 0)
00079 return "";
00080
00081 return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
00082 }
00083 }
00084
00088 public string AssemblyCompany
00089 {
00090 get
00091 {
00092
00093 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
00094
00095 if (attributes.Length == 0)
00096 return "";
00097
00098 return ((AssemblyCompanyAttribute)attributes[0]).Company;
00099 }
00100 }
00101 #endregion
00102 }
00103 }