using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; namespace grapher { partial class AboutBox : Form { public AboutBox(Version driver) { InitializeComponent(); this.Text = String.Format("About {0}", AssemblyTitle); this.labelVersion.Text = String.Format("GUI Version {0}", AssemblyVersion); this.labelDriverVersion.Text = String.Format("Driver Version {0}", driver.ToString()); } #region Assembly Attribute Accessors public static string AssemblyTitle { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); if (attributes.Length > 0) { AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; if (titleAttribute.Title != "") { return titleAttribute.Title; } } return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); } } public static string AssemblyVersion { get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } #endregion } }