|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.ComponentModel; |
| 4 | +using System.Drawing; |
| 5 | +using System.Linq; |
| 6 | +using System.Reflection; |
| 7 | +using System.Windows.Forms; |
| 8 | +using System.Diagnostics; |
| 9 | + |
| 10 | +namespace Caffeinated { |
| 11 | + partial class AboutForm : BaseForm { |
| 12 | + public AboutForm() : base() { |
| 13 | + InitializeComponent(); |
| 14 | + caffeineLbl.Links[0].LinkData = |
| 15 | + "http://lightheadsw.com/caffeine/"; |
| 16 | + visualpharmaLbl.Links[0].LinkData = |
| 17 | + "http://www.visualpharm.com/office_space_icon_set/"; |
| 18 | + dmndLbl.Links[0].LinkData = |
| 19 | + "http://desmondbrand.com/caffeinated"; |
| 20 | + } |
| 21 | + |
| 22 | + #region Assembly Attribute Accessors |
| 23 | + |
| 24 | + public string AssemblyTitle { |
| 25 | + get { |
| 26 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); |
| 27 | + if (attributes.Length > 0) { |
| 28 | + AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; |
| 29 | + if (titleAttribute.Title != "") { |
| 30 | + return titleAttribute.Title; |
| 31 | + } |
| 32 | + } |
| 33 | + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + public string AssemblyVersion { |
| 38 | + get { |
| 39 | + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + public string AssemblyDescription { |
| 44 | + get { |
| 45 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); |
| 46 | + if (attributes.Length == 0) { |
| 47 | + return ""; |
| 48 | + } |
| 49 | + return ((AssemblyDescriptionAttribute)attributes[0]).Description; |
| 50 | + } |
| 51 | + } |
| 52 | + |
| 53 | + public string AssemblyProduct { |
| 54 | + get { |
| 55 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); |
| 56 | + if (attributes.Length == 0) { |
| 57 | + return ""; |
| 58 | + } |
| 59 | + return ((AssemblyProductAttribute)attributes[0]).Product; |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + public string AssemblyCopyright { |
| 64 | + get { |
| 65 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); |
| 66 | + if (attributes.Length == 0) { |
| 67 | + return ""; |
| 68 | + } |
| 69 | + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + public string AssemblyCompany { |
| 74 | + get { |
| 75 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); |
| 76 | + if (attributes.Length == 0) { |
| 77 | + return ""; |
| 78 | + } |
| 79 | + return ((AssemblyCompanyAttribute)attributes[0]).Company; |
| 80 | + } |
| 81 | + } |
| 82 | + #endregion |
| 83 | + |
| 84 | + private void linkLbl_LinkClicked( |
| 85 | + object sender, |
| 86 | + LinkLabelLinkClickedEventArgs e |
| 87 | + ) { |
| 88 | + string target = e.Link.LinkData as string; |
| 89 | + System.Diagnostics.Process.Start(target); |
| 90 | + } |
| 91 | + |
| 92 | + } |
| 93 | +} |
0 commit comments