diff options
Diffstat (limited to 'src/Notepad/Presentation/Views/Menu/Help/AboutApplicationView.cs')
| -rw-r--r-- | src/Notepad/Presentation/Views/Menu/Help/AboutApplicationView.cs | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/Notepad/Presentation/Views/Menu/Help/AboutApplicationView.cs b/src/Notepad/Presentation/Views/Menu/Help/AboutApplicationView.cs new file mode 100644 index 0000000..515a493 --- /dev/null +++ b/src/Notepad/Presentation/Views/Menu/Help/AboutApplicationView.cs @@ -0,0 +1,99 @@ +using System.IO;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace Notepad.Presentation.Views.Menu.Help {
+ public partial class AboutApplicationView : Form, IAboutApplicationView {
+ public AboutApplicationView() {
+ InitializeComponent();
+ labelProductName.Text = AssemblyProduct;
+ labelVersion.Text = string.Format("Version {0} {0}", AssemblyVersion);
+ uxCopyright.Text = AssemblyCopyright;
+ uxCompanyName.Text = AssemblyCompany;
+ uxDescription.Text = AssemblyDescription;
+ }
+
+ public void Display() {
+ ShowDialog();
+ }
+
+ 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 Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
+ }
+ }
+
+ public string AssemblyVersion
+ {
+ get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
+ }
+
+ public string AssemblyDescription
+ {
+ get
+ {
+ object[] attributes =
+ Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
+ if (attributes.Length == 0)
+ {
+ return "";
+ }
+ return ((AssemblyDescriptionAttribute)attributes[0]).Description;
+ }
+ }
+
+ public string AssemblyProduct
+ {
+ get
+ {
+ object[] attributes =
+ Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
+ if (attributes.Length == 0)
+ {
+ return "";
+ }
+ return ((AssemblyProductAttribute)attributes[0]).Product;
+ }
+ }
+
+ public string AssemblyCopyright
+ {
+ get
+ {
+ object[] attributes =
+ Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
+ if (attributes.Length == 0)
+ {
+ return "";
+ }
+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ }
+ }
+
+ public string AssemblyCompany
+ {
+ get
+ {
+ object[] attributes =
+ Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
+ if (attributes.Length == 0)
+ {
+ return "";
+ }
+ return ((AssemblyCompanyAttribute)attributes[0]).Company;
+ }
+ }
+ }
+}
\ No newline at end of file |
