wfrm_Error.cs
上传用户:horngjaan
上传日期:2009-12-12
资源大小:2882k
文件大小:11k
源码类别:

Email服务器

开发平台:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace LumiSoft.MailServer
  7. {
  8. /// <summary>
  9. /// Error report form.
  10. /// </summary>
  11. public class wfrm_Error : System.Windows.Forms.Form
  12. {
  13. private LumiSoft.UI.Controls.WPictureBox m_pImage;
  14. private LumiSoft.UI.Controls.WButton m_pClose;
  15. private LumiSoft.UI.Controls.WButton m_pExtend;
  16. private LumiSoft.UI.Controls.WEditBox m_pErrorText;
  17. private LumiSoft.UI.Controls.WEditBox m_pMessage;
  18. private System.Windows.Forms.ImageList imgList;
  19. private LumiSoft.UI.Controls.WLabel mt_error;
  20. private System.Windows.Forms.ImageList imageList1;
  21. private LumiSoft.UI.Controls.WEditBox wEditBox1;
  22. private LumiSoft.UI.Controls.WLabel wLabel1;
  23. private System.ComponentModel.IContainer components;
  24. /// <summary>
  25. /// Default constructor.
  26. /// </summary>
  27. public wfrm_Error(Exception x,System.Diagnostics.StackTrace stack)
  28. {
  29. //
  30. // Required for Windows Form Designer support
  31. //
  32. InitializeComponent();
  33. //
  34. // TODO: Add any constructor code after InitializeComponent call
  35. //
  36. this.Height = 210;
  37. m_pImage.Image = imageList1.Images[0];
  38. m_pMessage.Text = x.Message;
  39. wEditBox1.Text = stack.GetFrame(0).GetMethod().DeclaringType.FullName + "." + stack.GetFrame(0).GetMethod().Name + "()";
  40. m_pErrorText.Text = x.StackTrace;
  41. }
  42. #region fucntion Dispose
  43. /// <summary>
  44. /// Clean up any resources being used.
  45. /// </summary>
  46. protected override void Dispose( bool disposing )
  47. {
  48. if( disposing )
  49. {
  50. if(components != null)
  51. {
  52. components.Dispose();
  53. }
  54. }
  55. base.Dispose( disposing );
  56. }
  57. #endregion
  58. #region Windows Form Designer generated code
  59. /// <summary>
  60. /// Required method for Designer support - do not modify
  61. /// the contents of this method with the code editor.
  62. /// </summary>
  63. private void InitializeComponent()
  64. {
  65. this.components = new System.ComponentModel.Container();
  66. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(wfrm_Error));
  67. this.m_pImage = new LumiSoft.UI.Controls.WPictureBox();
  68. this.m_pClose = new LumiSoft.UI.Controls.WButton();
  69. this.m_pExtend = new LumiSoft.UI.Controls.WButton();
  70. this.m_pErrorText = new LumiSoft.UI.Controls.WEditBox();
  71. this.m_pMessage = new LumiSoft.UI.Controls.WEditBox();
  72. this.imgList = new System.Windows.Forms.ImageList(this.components);
  73. this.mt_error = new LumiSoft.UI.Controls.WLabel();
  74. this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  75. this.wEditBox1 = new LumiSoft.UI.Controls.WEditBox();
  76. this.wLabel1 = new LumiSoft.UI.Controls.WLabel();
  77. ((System.ComponentModel.ISupportInitialize)(this.m_pImage)).BeginInit();
  78. ((System.ComponentModel.ISupportInitialize)(this.m_pClose)).BeginInit();
  79. ((System.ComponentModel.ISupportInitialize)(this.m_pExtend)).BeginInit();
  80. ((System.ComponentModel.ISupportInitialize)(this.m_pErrorText)).BeginInit();
  81. ((System.ComponentModel.ISupportInitialize)(this.m_pMessage)).BeginInit();
  82. ((System.ComponentModel.ISupportInitialize)(this.wEditBox1)).BeginInit();
  83. this.SuspendLayout();
  84. // 
  85. // m_pImage
  86. // 
  87. this.m_pImage.Image = null;
  88. this.m_pImage.Location = new System.Drawing.Point(232, 16);
  89. this.m_pImage.Name = "m_pImage";
  90. this.m_pImage.Size = new System.Drawing.Size(200, 112);
  91. this.m_pImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Normal;
  92. this.m_pImage.TabIndex = 28;
  93. this.m_pImage.UseStaticViewStyle = true;
  94. // 
  95. // m_pClose
  96. // 
  97. this.m_pClose.Location = new System.Drawing.Point(360, 144);
  98. this.m_pClose.Name = "m_pClose";
  99. this.m_pClose.Size = new System.Drawing.Size(72, 24);
  100. this.m_pClose.TabIndex = 15;
  101. this.m_pClose.Text = "Close";
  102. this.m_pClose.UseStaticViewStyle = true;
  103. this.m_pClose.ButtonPressed += new LumiSoft.UI.Controls.ButtonPressedEventHandler(this.m_pClose_ButtonPressed);
  104. // 
  105. // m_pExtend
  106. // 
  107. this.m_pExtend.Location = new System.Drawing.Point(280, 144);
  108. this.m_pExtend.Name = "m_pExtend";
  109. this.m_pExtend.Size = new System.Drawing.Size(72, 24);
  110. this.m_pExtend.TabIndex = 17;
  111. this.m_pExtend.Text = "More";
  112. this.m_pExtend.UseStaticViewStyle = true;
  113. this.m_pExtend.ButtonPressed += new LumiSoft.UI.Controls.ButtonPressedEventHandler(this.m_pExtend_ButtonPressed);
  114. // 
  115. // m_pErrorText
  116. // 
  117. this.m_pErrorText.DecimalPlaces = 2;
  118. this.m_pErrorText.DecMaxValue = new System.Decimal(new int[] {
  119.  999999999,
  120.  0,
  121.  0,
  122.  0});
  123. this.m_pErrorText.DecMinValue = new System.Decimal(new int[] {
  124.  999999999,
  125.  0,
  126.  0,
  127.  -2147483648});
  128. this.m_pErrorText.Lines = new string[0];
  129. this.m_pErrorText.Location = new System.Drawing.Point(8, 200);
  130. this.m_pErrorText.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
  131. this.m_pErrorText.MaxLength = 32767;
  132. this.m_pErrorText.Multiline = true;
  133. this.m_pErrorText.Name = "m_pErrorText";
  134. this.m_pErrorText.PasswordChar = '';
  135. this.m_pErrorText.ReadOnly = true;
  136. this.m_pErrorText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
  137. this.m_pErrorText.Size = new System.Drawing.Size(432, 184);
  138. this.m_pErrorText.TabIndex = 24;
  139. this.m_pErrorText.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
  140. this.m_pErrorText.UseStaticViewStyle = true;
  141. // 
  142. // m_pMessage
  143. // 
  144. this.m_pMessage.DecimalPlaces = 2;
  145. this.m_pMessage.DecMaxValue = new System.Decimal(new int[] {
  146.    999999999,
  147.    0,
  148.    0,
  149.    0});
  150. this.m_pMessage.DecMinValue = new System.Decimal(new int[] {
  151.    999999999,
  152.    0,
  153.    0,
  154.    -2147483648});
  155. this.m_pMessage.Lines = new string[0];
  156. this.m_pMessage.Location = new System.Drawing.Point(8, 16);
  157. this.m_pMessage.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
  158. this.m_pMessage.MaxLength = 32767;
  159. this.m_pMessage.Multiline = true;
  160. this.m_pMessage.Name = "m_pMessage";
  161. this.m_pMessage.PasswordChar = '';
  162. this.m_pMessage.ReadOnly = true;
  163. this.m_pMessage.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
  164. this.m_pMessage.Size = new System.Drawing.Size(208, 112);
  165. this.m_pMessage.TabIndex = 19;
  166. this.m_pMessage.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
  167. this.m_pMessage.UseStaticViewStyle = true;
  168. // 
  169. // imgList
  170. // 
  171. this.imgList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  172. this.imgList.ImageSize = new System.Drawing.Size(200, 100);
  173. this.imgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList.ImageStream")));
  174. this.imgList.TransparentColor = System.Drawing.Color.Transparent;
  175. // 
  176. // mt_error
  177. // 
  178. this.mt_error.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  179. this.mt_error.Location = new System.Drawing.Point(8, 184);
  180. this.mt_error.Name = "mt_error";
  181. this.mt_error.Size = new System.Drawing.Size(150, 16);
  182. this.mt_error.TabIndex = 27;
  183. this.mt_error.Text = "Error report:";
  184. this.mt_error.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
  185. this.mt_error.UseStaticViewStyle = true;
  186. // 
  187. // imageList1
  188. // 
  189. this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  190. this.imageList1.ImageSize = new System.Drawing.Size(200, 120);
  191. this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
  192. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  193. // 
  194. // wEditBox1
  195. // 
  196. this.wEditBox1.DecimalPlaces = 2;
  197. this.wEditBox1.DecMaxValue = new System.Decimal(new int[] {
  198.   999999999,
  199.   0,
  200.   0,
  201.   0});
  202. this.wEditBox1.DecMinValue = new System.Decimal(new int[] {
  203.   999999999,
  204.   0,
  205.   0,
  206.   -2147483648});
  207. this.wEditBox1.Lines = new string[0];
  208. this.wEditBox1.Location = new System.Drawing.Point(8, 149);
  209. this.wEditBox1.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
  210. this.wEditBox1.MaxLength = 32767;
  211. this.wEditBox1.Multiline = false;
  212. this.wEditBox1.Name = "wEditBox1";
  213. this.wEditBox1.PasswordChar = '';
  214. this.wEditBox1.ReadOnly = false;
  215. this.wEditBox1.ScrollBars = System.Windows.Forms.ScrollBars.None;
  216. this.wEditBox1.Size = new System.Drawing.Size(264, 20);
  217. this.wEditBox1.TabIndex = 29;
  218. this.wEditBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
  219. this.wEditBox1.UseStaticViewStyle = false;
  220. this.wEditBox1.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
  221. // 
  222. // wLabel1
  223. // 
  224. this.wLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  225. this.wLabel1.Location = new System.Drawing.Point(8, 130);
  226. this.wLabel1.Name = "wLabel1";
  227. this.wLabel1.Size = new System.Drawing.Size(176, 16);
  228. this.wLabel1.TabIndex = 30;
  229. this.wLabel1.Text = "Function:";
  230. this.wLabel1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
  231. this.wLabel1.UseStaticViewStyle = false;
  232. // 
  233. // wfrm_Error
  234. // 
  235. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  236. this.ClientSize = new System.Drawing.Size(448, 397);
  237. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  238.   this.wLabel1,
  239.   this.wEditBox1,
  240.   this.m_pImage,
  241.   this.m_pClose,
  242.   this.m_pExtend,
  243.   this.m_pErrorText,
  244.   this.m_pMessage,
  245.   this.mt_error});
  246. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  247. this.MaximizeBox = false;
  248. this.MinimizeBox = false;
  249. this.Name = "wfrm_Error";
  250. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  251. this.Text = "Error Info";
  252. ((System.ComponentModel.ISupportInitialize)(this.m_pImage)).EndInit();
  253. ((System.ComponentModel.ISupportInitialize)(this.m_pClose)).EndInit();
  254. ((System.ComponentModel.ISupportInitialize)(this.m_pExtend)).EndInit();
  255. ((System.ComponentModel.ISupportInitialize)(this.m_pErrorText)).EndInit();
  256. ((System.ComponentModel.ISupportInitialize)(this.m_pMessage)).EndInit();
  257. ((System.ComponentModel.ISupportInitialize)(this.wEditBox1)).EndInit();
  258. this.ResumeLayout(false);
  259. }
  260. #endregion
  261. #region Events handling
  262. #region function  m_pClose_ButtonPressed
  263. private void m_pClose_ButtonPressed(object sender, System.EventArgs e)
  264. {
  265. this.Close();
  266. }
  267. #endregion
  268. #region function m_pExtend_ButtonPressed
  269. private void m_pExtend_ButtonPressed(object sender, System.EventArgs e)
  270. {
  271. this.Height = 422;
  272. }
  273. #endregion
  274. #endregion
  275. }
  276. }