161 lines
5.4 KiB
C#
161 lines
5.4 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AyaNova
|
|
{
|
|
/// <summary>
|
|
/// Summary description for ExceptionDialog.
|
|
/// </summary>
|
|
public class ExceptionDialog : System.Windows.Forms.Form
|
|
{
|
|
private System.Windows.Forms.TextBox edMessage;
|
|
private System.Windows.Forms.MainMenu mainMenu1;
|
|
private System.Windows.Forms.MenuItem mnuAbort;
|
|
private System.Windows.Forms.MenuItem mnuIgnore;
|
|
private System.Windows.Forms.MenuItem mnuCopy;
|
|
private IContainer components;
|
|
private string mDisplay="";
|
|
private bool mFatal=false;
|
|
private bool mClosingHandled=false;
|
|
public ExceptionDialog(string Display, bool Fatal)
|
|
{
|
|
//
|
|
// Required for Windows Form Designer support
|
|
//
|
|
InitializeComponent();
|
|
|
|
mDisplay=Display;
|
|
mFatal=Fatal;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clean up any resources being used.
|
|
/// </summary>
|
|
protected override void Dispose( bool disposing )
|
|
{
|
|
if( disposing )
|
|
{
|
|
if(components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
}
|
|
base.Dispose( disposing );
|
|
}
|
|
|
|
#region Windows Form Designer generated code
|
|
/// <summary>
|
|
/// Required method for Designer support - do not modify
|
|
/// the contents of this method with the code editor.
|
|
/// </summary>
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = new System.ComponentModel.Container();
|
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionDialog));
|
|
this.edMessage = new System.Windows.Forms.TextBox();
|
|
this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
|
|
this.mnuAbort = new System.Windows.Forms.MenuItem();
|
|
this.mnuIgnore = new System.Windows.Forms.MenuItem();
|
|
this.mnuCopy = new System.Windows.Forms.MenuItem();
|
|
this.SuspendLayout();
|
|
//
|
|
// edMessage
|
|
//
|
|
this.edMessage.AcceptsReturn = true;
|
|
this.edMessage.AcceptsTab = true;
|
|
this.edMessage.BackColor = System.Drawing.Color.White;
|
|
this.edMessage.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
this.edMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
this.edMessage.ForeColor = System.Drawing.Color.Black;
|
|
this.edMessage.Location = new System.Drawing.Point(0, 0);
|
|
this.edMessage.Multiline = true;
|
|
this.edMessage.Name = "edMessage";
|
|
this.edMessage.ReadOnly = true;
|
|
this.edMessage.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
|
this.edMessage.Size = new System.Drawing.Size(569, 406);
|
|
this.edMessage.TabIndex = 0;
|
|
//
|
|
// mainMenu1
|
|
//
|
|
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
|
this.mnuAbort,
|
|
this.mnuIgnore,
|
|
this.mnuCopy});
|
|
//
|
|
// mnuAbort
|
|
//
|
|
this.mnuAbort.Index = 0;
|
|
this.mnuAbort.Text = "&Abort";
|
|
this.mnuAbort.Click += new System.EventHandler(this.mnuAbort_Click);
|
|
//
|
|
// mnuIgnore
|
|
//
|
|
this.mnuIgnore.Index = 1;
|
|
this.mnuIgnore.Text = "&Ignore";
|
|
this.mnuIgnore.Click += new System.EventHandler(this.mnuIgnore_Click);
|
|
//
|
|
// mnuCopy
|
|
//
|
|
this.mnuCopy.Index = 2;
|
|
this.mnuCopy.Text = "&Copy all";
|
|
this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click);
|
|
//
|
|
// ExceptionDialog
|
|
//
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
|
this.ClientSize = new System.Drawing.Size(569, 406);
|
|
this.Controls.Add(this.edMessage);
|
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
|
this.MaximizeBox = false;
|
|
this.Menu = this.mainMenu1;
|
|
this.MinimizeBox = false;
|
|
this.Name = "ExceptionDialog";
|
|
this.ShowInTaskbar = false;
|
|
this.Closing += new System.ComponentModel.CancelEventHandler(this.ExceptionDialog_Closing);
|
|
this.Load += new System.EventHandler(this.ExceptionDialog_Load);
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
|
|
}
|
|
#endregion
|
|
|
|
private void mnuAbort_Click(object sender, System.EventArgs e)
|
|
{
|
|
this.DialogResult=DialogResult.Abort;
|
|
mClosingHandled=true;
|
|
this.Close();
|
|
|
|
}
|
|
|
|
private void mnuIgnore_Click(object sender, System.EventArgs e)
|
|
{
|
|
this.DialogResult=DialogResult.Ignore;
|
|
mClosingHandled=true;
|
|
this.Close();
|
|
|
|
}
|
|
|
|
private void mnuCopy_Click(object sender, System.EventArgs e)
|
|
{
|
|
Clipboard.SetDataObject(mDisplay);
|
|
|
|
}
|
|
|
|
private void ExceptionDialog_Load(object sender, System.EventArgs e)
|
|
{
|
|
mnuIgnore.Visible=!this.mFatal;
|
|
edMessage.Text=mDisplay;
|
|
edMessage.Select(1,0);
|
|
}
|
|
|
|
private void ExceptionDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
if(!mClosingHandled)
|
|
this.DialogResult=DialogResult.Abort;
|
|
}
|
|
}
|
|
}
|