AboutForm.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. namespace Easychart.Finance.Win
  2. {
  3. using System;
  4. using System.ComponentModel;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.Reflection;
  8. using System.Windows.Forms;
  9. [ToolboxItem(false)]
  10. public class AboutForm : Form
  11. {
  12. private System.Windows.Forms.Button btnOK;
  13. private Button btnSystemInfo;
  14. private ColumnHeader chName;
  15. private ColumnHeader chVersion;
  16. private Container components = null;
  17. private Label label1;
  18. private Label label2;
  19. private LinkLabel lbEMail;
  20. private LinkLabel lbSite;
  21. private Label lComponent;
  22. private Label lCopyright;
  23. private Label lName;
  24. private ListView lvAssembly;
  25. private Label lVersion;
  26. public AboutForm()
  27. {
  28. this.InitializeComponent();
  29. }
  30. private void AboutForm_Load(object sender, EventArgs e)
  31. {
  32. Assembly executingAssembly = Assembly.GetExecutingAssembly();
  33. this.lCopyright.Text = ((AssemblyCopyrightAttribute) Attribute.GetCustomAttribute(executingAssembly, typeof(AssemblyCopyrightAttribute))).Copyright;
  34. this.lVersion.Text = "Version : " + Application.ProductVersion;
  35. this.lName.Text = Application.ProductName;
  36. this.lbSite.Links[0].LinkData = this.lbSite.Text;
  37. this.lbEMail.Links[0].LinkData = this.lbEMail.Text;
  38. foreach (AssemblyName name in executingAssembly.GetReferencedAssemblies())
  39. {
  40. this.lvAssembly.Items.Add(name.Name).SubItems.Add(name.Version.ToString());
  41. }
  42. }
  43. private void btnSystemInfo_Click(object sender, EventArgs e)
  44. {
  45. Process.Start("MSInfo32.exe");
  46. }
  47. protected override void Dispose(bool disposing)
  48. {
  49. if (disposing && (this.components != null))
  50. {
  51. this.components.Dispose();
  52. }
  53. base.Dispose(disposing);
  54. }
  55. private void InitializeComponent()
  56. {
  57. this.lName = new Label();
  58. this.lvAssembly = new ListView();
  59. this.chName = new ColumnHeader();
  60. this.chVersion = new ColumnHeader();
  61. this.btnOK = new Button();
  62. this.btnSystemInfo = new Button();
  63. this.lbSite = new LinkLabel();
  64. this.lVersion = new Label();
  65. this.lCopyright = new Label();
  66. this.lComponent = new Label();
  67. this.lbEMail = new LinkLabel();
  68. this.label1 = new Label();
  69. this.label2 = new Label();
  70. base.SuspendLayout();
  71. this.lName.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  72. this.lName.Font = new Font("Verdana", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  73. this.lName.Location = new Point(15, 0x10);
  74. this.lName.Name = "lName";
  75. this.lName.Size = new Size(360, 0x10);
  76. this.lName.TabIndex = 0;
  77. this.lName.Text = "Easy Financial Chart Windows Demo";
  78. this.lvAssembly.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
  79. this.lvAssembly.Columns.AddRange(new ColumnHeader[] { this.chName, this.chVersion });
  80. this.lvAssembly.GridLines = true;
  81. this.lvAssembly.Location = new Point(0x10, 0x4d);
  82. this.lvAssembly.Name = "lvAssembly";
  83. this.lvAssembly.Size = new Size(0x1c8, 0x7b);
  84. this.lvAssembly.TabIndex = 1;
  85. this.lvAssembly.View = View.Details;
  86. this.chName.Text = "Name";
  87. this.chName.Width = 0xcd;
  88. this.chVersion.Text = "Version";
  89. this.chVersion.Width = 0xa1;
  90. this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
  91. this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
  92. this.btnOK.Location = new Point(0x170, 0xd9);
  93. this.btnOK.Name = "btnOK";
  94. this.btnOK.Size = new Size(0x60, 0x17);
  95. this.btnOK.TabIndex = 2;
  96. this.btnOK.Text = "OK";
  97. this.btnSystemInfo.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
  98. this.btnSystemInfo.Location = new Point(0x170, 0xf9);
  99. this.btnSystemInfo.Name = "btnSystemInfo";
  100. this.btnSystemInfo.Size = new Size(0x60, 0x17);
  101. this.btnSystemInfo.TabIndex = 3;
  102. this.btnSystemInfo.Text = "System Info";
  103. this.btnSystemInfo.Click += new EventHandler(this.btnSystemInfo_Click);
  104. this.lbSite.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  105. this.lbSite.AutoSize = true;
  106. this.lbSite.Location = new Point(80, 0xd8);
  107. this.lbSite.Name = "lbSite";
  108. this.lbSite.Size = new Size(0xa6, 0x11);
  109. this.lbSite.TabIndex = 4;
  110. this.lbSite.TabStop = true;
  111. this.lbSite.Text = "http://finance.easychart.net";
  112. this.lbSite.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lbSite_LinkClicked);
  113. this.lVersion.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  114. this.lVersion.AutoSize = true;
  115. this.lVersion.Location = new Point(15, 0x25);
  116. this.lVersion.Name = "lVersion";
  117. this.lVersion.Size = new Size(0x41, 0x11);
  118. this.lVersion.TabIndex = 5;
  119. this.lVersion.Text = "<Version>";
  120. this.lCopyright.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  121. this.lCopyright.AutoSize = true;
  122. this.lCopyright.Location = new Point(15, 0x108);
  123. this.lCopyright.Name = "lCopyright";
  124. this.lCopyright.Size = new Size(0x55, 0x11);
  125. this.lCopyright.TabIndex = 6;
  126. this.lCopyright.Text = "<Copy Right>";
  127. this.lComponent.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  128. this.lComponent.AutoSize = true;
  129. this.lComponent.Location = new Point(15, 0x3a);
  130. this.lComponent.Name = "lComponent";
  131. this.lComponent.Size = new Size(0x7e, 0x11);
  132. this.lComponent.TabIndex = 7;
  133. this.lComponent.Text = "Product components:";
  134. this.lbEMail.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  135. this.lbEMail.AutoSize = true;
  136. this.lbEMail.Location = new Point(80, 240);
  137. this.lbEMail.Name = "lbEMail";
  138. this.lbEMail.Size = new Size(0xb1, 0x11);
  139. this.lbEMail.TabIndex = 8;
  140. this.lbEMail.TabStop = true;
  141. this.lbEMail.Text = "mailto:support@easychart.net";
  142. this.lbEMail.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lbSite_LinkClicked);
  143. this.label1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  144. this.label1.Location = new Point(0x10, 0xd9);
  145. this.label1.Name = "label1";
  146. this.label1.Size = new Size(0x30, 0x10);
  147. this.label1.TabIndex = 9;
  148. this.label1.Text = "Home:";
  149. this.label2.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  150. this.label2.AutoSize = true;
  151. this.label2.Location = new Point(0x10, 240);
  152. this.label2.Name = "label2";
  153. this.label2.Size = new Size(0x37, 0x11);
  154. this.label2.TabIndex = 10;
  155. this.label2.Text = "Support:";
  156. base.AcceptButton = this.btnOK;
  157. this.AutoScaleBaseSize = new Size(6, 14);
  158. base.CancelButton = this.btnOK;
  159. base.ClientSize = new Size(490, 0x130);
  160. base.ControlBox = false;
  161. base.Controls.Add(this.label2);
  162. base.Controls.Add(this.label1);
  163. base.Controls.Add(this.lbEMail);
  164. base.Controls.Add(this.lComponent);
  165. base.Controls.Add(this.lCopyright);
  166. base.Controls.Add(this.lVersion);
  167. base.Controls.Add(this.lbSite);
  168. base.Controls.Add(this.btnSystemInfo);
  169. base.Controls.Add(this.btnOK);
  170. base.Controls.Add(this.lvAssembly);
  171. base.Controls.Add(this.lName);
  172. this.Font = new Font("Verdana", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
  173. base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  174. base.Name = "AboutForm";
  175. base.ShowInTaskbar = false;
  176. base.StartPosition = FormStartPosition.CenterParent;
  177. this.Text = "About";
  178. base.Load += new EventHandler(this.AboutForm_Load);
  179. base.ResumeLayout(false);
  180. }
  181. private void lbSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  182. {
  183. Process.Start(e.Link.LinkData.ToString());
  184. }
  185. public static void ShowForm()
  186. {
  187. new AboutForm().ShowDialog();
  188. }
  189. }
  190. }