|
| 1 | +using System; |
| 2 | +using System.Resources; |
| 3 | +using System.Reflection; |
| 4 | +using System.Drawing; |
| 5 | +using System.Diagnostics; |
| 6 | +using System.Windows.Forms; |
| 7 | + |
| 8 | +namespace Auto_Machine |
| 9 | +{ |
| 10 | + public partial class About : Form |
| 11 | + { |
| 12 | + #region Language |
| 13 | + private void SetLanguage(string language) |
| 14 | + { |
| 15 | + ResourceManager appLanguage = new ResourceManager("Auto_Machine.Resources.language_" + language, Assembly.GetExecutingAssembly()); |
| 16 | + label_version.Text = appLanguage.GetString("Version"); |
| 17 | + label_contact.Text = appLanguage.GetString("Contact"); |
| 18 | + } |
| 19 | + #endregion |
| 20 | + |
| 21 | + #region Main |
| 22 | + private AutoMachine MainForm; |
| 23 | + public About(AutoMachine MainForm) |
| 24 | + { |
| 25 | + InitializeComponent(); |
| 26 | + this.MainForm = MainForm; |
| 27 | + SetLanguage(MainForm.language); |
| 28 | + } |
| 29 | + private void About_Load(object sender, EventArgs e) |
| 30 | + { |
| 31 | + MainForm.aboutopen = true; |
| 32 | + int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width - 8; |
| 33 | + int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height - 7; |
| 34 | + this.Location = new Point(x, y); |
| 35 | + label_version.Text = label_version.Text + (": " + version); |
| 36 | + label_copyright.Text = copyright; |
| 37 | + } |
| 38 | + private void About_FormClosing(object sender, FormClosingEventArgs e) |
| 39 | + { |
| 40 | + MainForm.aboutopen = false; |
| 41 | + } |
| 42 | + private void linkLabel_contact_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) |
| 43 | + { |
| 44 | + Process.Start("mailto:tinexcs@gmail.com"); |
| 45 | + } |
| 46 | + #endregion |
| 47 | + |
| 48 | + #region References |
| 49 | + public string version |
| 50 | + { |
| 51 | + get |
| 52 | + { |
| 53 | + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
| 54 | + } |
| 55 | + } |
| 56 | + public string copyright |
| 57 | + { |
| 58 | + get |
| 59 | + { |
| 60 | + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); |
| 61 | + if (attributes.Length == 0) |
| 62 | + { |
| 63 | + return ""; |
| 64 | + } |
| 65 | + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; |
| 66 | + } |
| 67 | + } |
| 68 | + #endregion |
| 69 | + |
| 70 | + private void button_exit_Click(object sender, EventArgs e) |
| 71 | + { |
| 72 | + Close(); |
| 73 | + } |
| 74 | + } |
| 75 | +} |
0 commit comments