diff options
| author | carverh <[email protected]> | 2016-07-21 16:01:19 -0700 |
|---|---|---|
| committer | carverh <[email protected]> | 2016-07-21 16:01:19 -0700 |
| commit | a1f8770e879259b4b71589c842e5eeb26a59f2fb (patch) | |
| tree | 9839226f202f7da734aa549fd18427747548731e /source/WindowsFormsApplication1/Apps/About.cs | |
| parent | 3730f2829e697312b0c912601e5d428829df7645 (diff) | |
| download | shiftos-c--a1f8770e879259b4b71589c842e5eeb26a59f2fb.tar.gz shiftos-c--a1f8770e879259b4b71589c842e5eeb26a59f2fb.tar.bz2 shiftos-c--a1f8770e879259b4b71589c842e5eeb26a59f2fb.zip | |
edit 2
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/About.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Apps/About.cs | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/Apps/About.cs b/source/WindowsFormsApplication1/Apps/About.cs new file mode 100644 index 0000000..995b696 --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/About.cs @@ -0,0 +1,115 @@ +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 ShiftOS.Apps +{ + partial class About : Form + { + public About() + { + InitializeComponent(); + this.Text = String.Format("About {0}", AssemblyTitle); + this.labelProductName.Text = AssemblyProduct; + this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); + this.labelCopyright.Text = AssemblyCopyright; + this.labelCompanyName.Text = AssemblyCompany; + this.textBoxDescription.Text = AssemblyDescription; + } + + #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(); + } + } + + 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; + } + } + #endregion + + private void logoPictureBox_Click(object sender, EventArgs e) + { + + } + + private void textBoxDescription_TextChanged(object sender, EventArgs e) + { + + } + } +} |
