private void backgroundWorker3_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { //var dialogComplete = new CustomDialog(); DialogResult result = new DialogResult(); // Check to see if an error occurred in the // background process. if (e.Error != null) { MessageBox.Show(e.Error.Message); } else // Check to see if the background process was cancelled. if (e.Cancelled) { MessageBox.Show("Processing cancelled."); } else { // Everything completed normally. // process the response using e.Result Analyze processor = e.Result as Analyze; var dialogComplete = new CustomDialog("Merging complete!", "Confirm", "OK", "Convert", "View in Explorer"); result = dialogComplete.ShowDialog(); //result = CustomDialog.Show("Merging complete!\n\nBut!\n\nWait!\n\nThere's more to it than it seems apparently through your boggling eyes (Yes, that's a new English word).\n\nOkay.", "Confirm", "OK", "Convert", "View in Explorer"); if (result == DialogResult.OK) { if (dialogComplete.buttonPressed == "View in Explorer") { processor.LaunchInExplorer(); } else if (dialogComplete.buttonPressed == "Convert") { Analyze analyzeMerged = new Analyze(); var mergedAnalyze = new ProgressForm(Analyze.outputGroups.ToArray(), analyzeMerged); mergedAnalyze.ShowDialog(); analyzeMerged = mergedAnalyze.analyzeData; var mergedConvert = new ProgressForm(2, analyzeMerged); mergedConvert.ShowDialog(); } else { this.Close(); } } } this.Close(); }
/// <summary> /// Shows a custom dialog with a new Title, Message, and up to three buttons with at least one button required. /// The custom dialog shows the button pressed in a buttonPressed public field. /// </summary> /// <param name="message">The message of the custom dialog.</param> /// <param name="title">The title of the custom dialog.</param> /// <param name="button1Text">Required. The text of the first button.</param> /// <param name="button2Text">Optional. The text of the second button.</param> /// <param name="button3Text">Optional. The text of the third button.</param> public static DialogResult Show(string message, string title, string button1Text, string button2Text = "", string button3Text = "") { CustomDialog customDialog = new CustomDialog(message, title, button1Text, button2Text, button3Text); DialogResult result = customDialog.ShowDialog(); return(result); }
/// <summary> /// Shows a custom dialog with a new Title, Message, and up to three buttons with at least one button required. /// The custom dialog shows the button pressed in a buttonPressed public field. /// </summary> /// <param name="message">The message of the custom dialog.</param> /// <param name="title">The title of the custom dialog.</param> /// <param name="button1Text">Required. The text of the first button.</param> /// <param name="button2Text">Optional. The text of the second button.</param> /// <param name="button3Text">Optional. The text of the third button.</param> public static DialogResult Show(string message, string title, string button1Text, string button2Text = "", string button3Text = "") { CustomDialog customDialog = new CustomDialog(message, title, button1Text, button2Text, button3Text); DialogResult result = customDialog.ShowDialog(); return result; }
private void backgroundWorker3_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { //var dialogComplete = new CustomDialog(); DialogResult result = new DialogResult(); // Check to see if an error occurred in the // background process. if (e.Error != null) { MessageBox.Show(e.Error.Message); } else // Check to see if the background process was cancelled. if (e.Cancelled) { MessageBox.Show("Processing cancelled."); } else { // Everything completed normally. // process the response using e.Result Analyze processor = e.Result as Analyze; var dialogComplete = new CustomDialog("Merging complete!", "Confirm", "OK", "Convert", "View in Explorer"); result = dialogComplete.ShowDialog(); //result = CustomDialog.Show("Merging complete!\n\nBut!\n\nWait!\n\nThere's more to it than it seems apparently through your boggling eyes (Yes, that's a new English word).\n\nOkay.", "Confirm", "OK", "Convert", "View in Explorer"); if (result == DialogResult.OK) { if (dialogComplete.buttonPressed == "View in Explorer") processor.LaunchInExplorer(); else if (dialogComplete.buttonPressed == "Convert") { Analyze analyzeMerged = new Analyze(); var mergedAnalyze = new ProgressForm(Analyze.outputGroups.ToArray(), analyzeMerged); mergedAnalyze.ShowDialog(); analyzeMerged = mergedAnalyze.analyzeData; var mergedConvert = new ProgressForm(2, analyzeMerged); mergedConvert.ShowDialog(); } else this.Close(); } } this.Close(); }