Inheritance: System.Windows.Forms.Form
 private static void DoShow(Control owner, string title, string message, Exception exception)
 {
     var dlg = new ExceptionMessageBox
     {
         Text = title,
         _message = { Text = message },
         _exception = { Text = exception.ToString() },
         _realException = exception
     };
     dlg._parameters = dlg.GetExceptionDetailsAndLog();
     dlg._exception.Visible = false;
     if (owner != null)
         dlg.ShowDialog(owner);
     else
         dlg.ShowDialog();
 }
Beispiel #2
0
        private static void DoShow(Control owner, string title, string message, Exception exception)
        {
            var dlg = new ExceptionMessageBox
            {
                Text           = title,
                _message       = { Text = message },
                _exception     = { Text = exception.ToString() },
                _realException = exception
            };

            dlg._parameters        = dlg.GetExceptionDetailsAndLog();
            dlg._exception.Visible = false;
            if (owner != null)
            {
                dlg.ShowDialog(owner);
            }
            else
            {
                dlg.ShowDialog();
            }
        }
        private void _audioAdd_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                try
                {
                    string outputFileName = Path.Combine(Path.GetDirectoryName(_settings.FileName), Path.GetFileNameWithoutExtension(dlg.FileName) + ".u8");
                    _audioFileService.Convert(dlg.FileName).WriteToFile(outputFileName);
                    var setting = new AudioPatternSetting
                    {
                        FileName = outputFileName,
                        Name     = Path.GetFileNameWithoutExtension(outputFileName)
                    };
                    AddOrUpdateAudioPattern(setting);
                }
                catch (Exception ex)
                {
                    ExceptionMessageBox.Show(this, "Error Adding Audio Pattern", "Could not add audio pattern.", ex);
                }
            }
        }