示例#1
0
 internal static UIDialogResult ShowDialog(UIMode uiMode, SerializableException exception, Report report)
 {
     if (Settings.CustomUIHandle != null)
     {
         var e = new CustomUIEventArgs(uiMode, exception, report);
         Settings.CustomUIHandle.DynamicInvoke(null, e);
         return(e.Result);
     }
     throw NBugConfigurationException.Create(() => Settings.UIMode,
                                             "Parameter supplied for settings property is invalid.");
 }
        private void Settings_CustomUIEvent(object sender, CustomUIEventArgs e)
        {
            var Form = new CustomPreviewForm();

            e.Result = Form.ShowDialog(e.Report);
        }
 /// <summary>
 /// Handles CustomUIEvent to show custom dialog when bug has occured
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Settings_CustomUIEvent(object sender, CustomUIEventArgs e)
 {
     MessageBox.Show(e.Exception.Message, "Custom Dialog", MessageBoxButton.OK, MessageBoxImage.Error);
 }