mirror of
https://github.com/RawAccelOfficial/rawaccel.git
synced 2025-05-13 21:05:07 +02:00
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
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
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
|
|
}
|
|
}
|