summaryrefslogtreecommitdiff
path: root/grapher/AboutBox.cs
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-12-02 05:25:19 -0500
committera1xd <[email protected]>2020-12-02 05:25:19 -0500
commit7d14daf1d5fce4d09471a3abe2aca49cf7680816 (patch)
tree43411443aadc79d36ad1da8063208cd51fdb15fe /grapher/AboutBox.cs
parentmerge common-install with common (diff)
downloadrawaccel-7d14daf1d5fce4d09471a3abe2aca49cf7680816.tar.xz
rawaccel-7d14daf1d5fce4d09471a3abe2aca49cf7680816.zip
embed version info into assemblies
check app versions against lib, lib against driver add an 'about' dialog which displays version details, accessible from menu refactor error handling + add check for negative offset
Diffstat (limited to 'grapher/AboutBox.cs')
-rw-r--r--grapher/AboutBox.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/grapher/AboutBox.cs b/grapher/AboutBox.cs
new file mode 100644
index 0000000..5547c59
--- /dev/null
+++ b/grapher/AboutBox.cs
@@ -0,0 +1,51 @@
+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 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().CodeBase);
+ }
+ }
+
+ public string AssemblyVersion
+ {
+ get
+ {
+ return Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ }
+ }
+
+ #endregion
+ }
+}