using System;
using System.Windows.Forms;

namespace FooEditor
{
    public partial class ExceptionDialog : Form
    {
        public ExceptionDialog()
        {
            InitializeComponent();
            this.AllowContinue = true;
        }

        public ExceptionDialog(Exception e) : this()
        {
            this.textBox1.AppendText(e.ToString());
        }

        public bool AllowContinue
        {
            get { return this.button2.Enabled; }
            set { this.button2.Enabled = value; }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            this.DialogResult = System.Windows.Forms.DialogResult.Abort;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            this.DialogResult = System.Windows.Forms.DialogResult.Ignore;
        }
    }
}
