private void setupButtonItem_Click(object sender, EventArgs e)
 {
     using (var uSettings = new UserSettings())
     {
         uSettings.WizardFinished += uSettings_WizardFinished;
         uSettings.ShowDialog();
     }
 }
        private void uSettings_WizardFinished(object sender, UserSettings.TrinityWizardFinishedEventArgs e)
        {
            SetProgramType();

            if (Settings.Default.raEnabled)
            {
                if (Settings.Default.raHost == String.Empty || Settings.Default.raPort == 0 ||
                Settings.Default.raUsername == String.Empty || Settings.Default.raPassword == String.Empty)
                {
                    TaskDialog.Show(new TaskDialogInfo("Wizard Failed", eTaskDialogIcon.Stop,
                    "You failed to complete the setup wizard...",
                    "TrinityCore Manager is now closing", eTaskDialogButton.Ok));

                    Application.Exit();
                }
            }
            else
            {
                if (Settings.Default.trinityFolder == String.Empty)
                {
                    TaskDialog.Show(new TaskDialogInfo("Wizard Failed", eTaskDialogIcon.Stop,
                    "You failed to complete the setup wizard...",
                    "TrinityCore Manager is now closing", eTaskDialogButton.Ok));

                    Application.Exit();
                }
            }
        }
        private void SetProgramType(bool start = true)
        {
            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort,
            Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);

            if (Settings.Default.raEnabled)
            {
                startServerButtonItem.Enabled = false;
                stopServerButtonItem.Enabled = false;

                backupDBButtonItem.Enabled = false;
                restoreDBButtonItem.Enabled = false;

                compileButtonItem.Enabled = false;

                if (Settings.Default.raHost == String.Empty || Settings.Default.raPort == 0 ||
                Settings.Default.raUsername == String.Empty || Settings.Default.raPassword == String.Empty ||
                Settings.Default.MySQLHost == String.Empty || Settings.Default.MySQLPort == 0 ||
                Settings.Default.MySQLUsername == String.Empty || Settings.Default.MySQLPassword == String.Empty)
                {
                    using (var uSettings = new UserSettings())
                    {
                        uSettings.WizardFinished += uSettings_WizardFinished;

                        uSettings.ShowDialog();
                    }
                }
                else
                {
                    if (start)
                        SetupRAConnection();

                    refreshValuesTimer.Enabled = true;
                }
            }
            else
            {
                backupDBButtonItem.Enabled = true;
                restoreDBButtonItem.Enabled = true;

                startServerButtonItem.Enabled = true;
                stopServerButtonItem.Enabled = false;

                compileButtonItem.Enabled = true;

                if (Settings.Default.trinityFolder == String.Empty || Settings.Default.MySQLHost == String.Empty ||
                Settings.Default.MySQLPort == 0 || Settings.Default.MySQLUsername == String.Empty ||
                Settings.Default.MySQLPassword == String.Empty)
                {
                    using (var uSettings = new UserSettings())
                    {
                        uSettings.WizardFinished += uSettings_WizardFinished;

                        uSettings.ShowDialog();
                    }
                }
                else
                {
                    refreshValuesTimer.Enabled = true;
                }
            }
        }