private void wizardTuning_NextClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
        {
            // Update coming pages based on listbox selection
            if (e.Page.Name == "wizSelectActionPage")
            {
                this.lblTuningActionConfirm.Text = this.listTuningActions.SelectedItem.ToString();
                frmMain.TuningAction selAction = (frmMain.TuningAction) this.listTuningActions.SelectedItem;
                if (selAction.WizCode != string.Empty)
                {
                    this.textPassword.Text = "";
                    //this.textPassword.Focus()
                    this.theCode.Text             = selAction.WizCode;
                    this.wizardCodePage.Visible   = true;
                    this.wizardCodePage.AllowNext = false;
                    this.lblAuthorText.Text       = "Hint: Try with authors first. For this Tuning Package it is " + selAction.WizAuth;
                    this.lblCode.Text             = "The Tuning Package \'" + this.listTuningActions.SelectedItem.ToString() + "\' requires that you enter the correct code.";
                }
            }

            // Perform the selected tuning action, and disable possibility to press cancel.
            // At this stage, it is to late. Modifications has been done.
            else if (e.Page.Name == "wizConfirmPage")
            {
                // Disable turning back
                this.wizCompletedPage.AllowCancel = false;
                frmMain.TuningAction selAction = (frmMain.TuningAction) this.listTuningActions.SelectedItem;

                // Perform the tuning action
                List <string> outList = new List <string>();
                if (selAction.performTuningAction(parent, softwareVersion, out outList) == 0)
                {
                    // Inform the user of the tuning action
                    this.wizCompletedPage.FinishText = "You have now completed the Tuning Action '" +
                                                       this.listTuningActions.SelectedItem.ToString() +
                                                       "'. Please check the modified maps below so that they are what you expect them to be." +
                                                       " Easiest way to do that is to compare to the original binary.";

                    // Fill list with impacted maps
                    foreach (string impM in outList)
                    {
                        this.listModifiedMaps.Items.Add(impM);
                    }

                    frmMain.TuningAction nameDate = frmMain.installedTunings.ElementAt(0);
                    if (nameDate.WizIdOrFilename == "ap_dateName")
                    {
                        nameDate.performTuningAction(parent, softwareVersion, out outList);
                        foreach (string impM in outList)
                        {
                            this.listModifiedMaps.Items.Add(impM);
                        }
                    }

                    // Show the message of the tuning pack if present
                    if (selAction.WizMsg != string.Empty)
                    {
                        MessageBox.Show(selAction.WizMsg, "Tuning Wizard Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    this.wizCompletedPage.FinishText = "The Tuning Action '" +
                                                       this.listTuningActions.SelectedItem.ToString() +
                                                       "' failed! You should likely not use this binary at this point.";
                }
            }
        }
 private void listTuningActions_SelectedIndexChanged(object sender, EventArgs e)
 {
     frmMain.TuningAction selAction = (frmMain.TuningAction) this.listTuningActions.SelectedItem;
     this.lblAuthor.Text = selAction.WizAuth;
 }