92 lines
2.8 KiB
C#
92 lines
2.8 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Moto_Logo
|
|
{
|
|
partial class AboutBox1 : Form
|
|
{
|
|
public AboutBox1()
|
|
{
|
|
InitializeComponent();
|
|
Text = String.Format("About {0}", AssemblyTitle);
|
|
labelProductName.Text = AssemblyProduct;
|
|
labelVersion.Text = Application.ProductVersion;
|
|
labelCopyright.Text = AssemblyCopyright;
|
|
labelCompanyName.Text = AssemblyCompany;
|
|
}
|
|
|
|
public override sealed string Text
|
|
{
|
|
get { return base.Text; }
|
|
set { base.Text = value; }
|
|
}
|
|
|
|
#region Assembly Attribute Accessors
|
|
|
|
public string AssemblyTitle
|
|
{
|
|
get
|
|
{
|
|
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
|
|
if (attributes.Length <= 0)
|
|
return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
|
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
|
|
return titleAttribute.Title != "" ? titleAttribute.Title : Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
|
}
|
|
}
|
|
|
|
public string AssemblyVersion
|
|
{
|
|
get
|
|
{
|
|
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
}
|
|
}
|
|
|
|
public string AssemblyDescription
|
|
{
|
|
get
|
|
{
|
|
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
|
|
return attributes.Length == 0 ? "" : ((AssemblyDescriptionAttribute)attributes[0]).Description;
|
|
}
|
|
}
|
|
|
|
public string AssemblyProduct
|
|
{
|
|
get
|
|
{
|
|
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
|
|
return attributes.Length == 0 ? "" : ((AssemblyProductAttribute)attributes[0]).Product;
|
|
}
|
|
}
|
|
|
|
public string AssemblyCopyright
|
|
{
|
|
get
|
|
{
|
|
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
|
return attributes.Length == 0 ? "" : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
|
}
|
|
}
|
|
|
|
public string AssemblyCompany
|
|
{
|
|
get
|
|
{
|
|
var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
|
|
return attributes.Length == 0 ? "" : ((AssemblyCompanyAttribute)attributes[0]).Company;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|