1
// ****************************************************************
2
// Copyright 2011, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
8
using System.Collections.Generic;
9
using System.ComponentModel;
11
using System.Reflection;
12
using System.Windows.Forms;
14
namespace NUnit.ProjectEditor
16
partial class AboutBox : Form
20
InitializeComponent();
21
this.Text = String.Format("About {0} {0}", AssemblyTitle);
22
this.labelProductName.Text = AssemblyProduct;
23
this.labelVersion.Text = String.Format("Version {0} {0}", AssemblyVersion);
24
this.labelCopyright.Text = AssemblyCopyright;
25
this.labelCompanyName.Text = AssemblyCompany;
26
this.textBoxDescription.Text = AssemblyDescription;
29
#region Assembly Attribute Accessors
31
public string AssemblyTitle
35
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
36
if (attributes.Length > 0)
38
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
39
if (titleAttribute.Title != "")
41
return titleAttribute.Title;
44
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
48
public string AssemblyVersion
52
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
56
public string AssemblyDescription
60
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
61
if (attributes.Length == 0)
65
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
69
public string AssemblyProduct
73
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
74
if (attributes.Length == 0)
78
return ((AssemblyProductAttribute)attributes[0]).Product;
82
public string AssemblyCopyright
86
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
87
if (attributes.Length == 0)
91
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
95
public string AssemblyCompany
99
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
100
if (attributes.Length == 0)
104
return ((AssemblyCompanyAttribute)attributes[0]).Company;