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();
        }
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                MessageBox.Show("Processing cancelled.");
            }
            else
            {
                Analyze      processor = e.Result as Analyze;
                DialogResult result    = new DialogResult();

                if (processor.hasOrdered)
                {
                    if (!Config.Configure.executeScriptAfter)
                    {
                        if (Config.Configure.doMakeScript)
                        {
                            result = MessageBox.Show("Analyze Done!\nShow output script(s) in default shell's file browser?", "Confirm", MessageBoxButtons.YesNo);
                            if (result == DialogResult.Yes)
                            {
                                processor.LaunchInExplorer(true);
                            }
                        }
                        else
                        {
                            result = MessageBox.Show("Analyze done!", "Analyze", MessageBoxButtons.OK);
                        }
                    }
                    else
                    {
                        result = MessageBox.Show("Done!\nThe program will now attempt to execute the script(s).", "Confirm", MessageBoxButtons.OK);
                        if (result == DialogResult.OK)
                        {
                            backgroundWorker2.RunWorkerAsync(processor);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("None of the files use an ordered chapter file.", "Confirm", MessageBoxButtons.OK);
                }
            }

            this.Close();
        }
        private void backgroundWorker4_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            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.");
            }
            // If shutdownDevice is true, shutdown the computer.
            else if (Config.Configure.ConvertConfigure.shutdownDevice)
            {
                Program.ShutdownDevice();
            }
            else
            {
                // Everything completed normally.
                // process the response using e.Result
                Analyze processor = e.Result as Analyze;
                result = MessageBox.Show("Conversion complete! View output files?", "Confirm", MessageBoxButtons.YesNo);

                if (result == DialogResult.Yes)
                {
                    processor.LaunchInExplorer();
                }
            }

            this.Close();
        }