Exemple #1
0
        private void gitProc_Exited(object sender, EventArgs e)
        {
            this.Invoke((MethodInvoker) delegate
            {
                DBProgressBarX.Value = 0;

                MySQLPercentLabelX.Visible = false;
                DBProgressBarX.Visible     = false;

                if (location != String.Empty)
                {
                    if (!dbBackgroundWorker.IsBusy)
                    {
                        if (mysql == null)
                        {
                            mysql = new SQLMethods(host, port, username, password);
                        }

                        Thread createMySQLDBs = new Thread(new ThreadStart(CreateMySQL));

                        DBProgressBarX.Visible = true;
                        createMySQLDBs.Start();
                    }
                    else
                    {
                    }
                }
                else
                {
                }
            });
        }
Exemple #2
0
        private void restoreDBBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string loc = String.Empty;

            foreach (string f in Directory.GetFiles(String.Format("{0}\\TrinityCore Manager\\backups", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))))
            {
                if (String.Format("{0:T}", GetDate(f)) == e.Argument.ToString())
                {
                    loc = f;
                }
            }

            if (loc != String.Empty && File.Exists(loc))
            {
                mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);

                if (mysql != null)
                {
                    try
                    {
                        mysql.ExecuteMySQLScript(loc);

                        restoreSuccess = true;
                    }
                    catch (Exception ex)
                    {
                        TaskDialog.Show(new TaskDialogInfo("Error", eTaskDialogIcon.Stop, "Error!", ex.Message, eTaskDialogButton.Ok));
                    }
                }
            }
        }
        private void NPCCreator_Load(object sender, EventArgs e)
        {
            //Set Default Values

            rankComboBoxEx.SelectedIndex         = 0;
            factionComboBoxEx.SelectedIndex      = 0;
            typeComboBoxEx.SelectedIndex         = 0;
            familyComboItemEx.SelectedIndex      = 0;
            classComboBoxEx.SelectedIndex        = 0;
            aiNameComboBoxEx.SelectedIndex       = 0;
            movementTypeComboBoxEx.SelectedIndex = 0;
            inhabitComboBoxEx.SelectedIndex      = 0;


            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);

            if (!editor)
            {
                //Test MySQL Connection

                wizardPage1.NextButtonEnabled = eWizardButtonState.False;

                MySQLConnProgressBarX.Enabled = true;
                MySQLConnProgressBarX.Visible = true;

                MySQLConnLabelX.Visible = true;

                MySQLConnBackgroundWorker.RunWorkerAsync();
            }
            else
            {
                //Get Item Information

                wizardPage1.NextButtonEnabled = eWizardButtonState.False;


                MySQLConnProgressBarX.Enabled = true;
                MySQLConnProgressBarX.Visible = true;

                MySQLConnLabelX.Visible = true;
                MySQLConnLabelX.Text    = "Getting NPC Information...";

                npcInfoBackgroundWorker.RunWorkerAsync();
            }
        }
        private void LootCreator_Load(object sender, EventArgs e)
        {
            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);


            bool testMySQL = mysql.TestMySQLConnection();

            if (!testMySQL)
            {
                TaskDialog.Show(new TaskDialogInfo("Error", eTaskDialogIcon.Stop, "Could Not Connect To MySQL", String.Empty, eTaskDialogButton.Ok));

                finished = true;

                this.Close();
            }

            if (editor)
            {
                lootInfoBackgroundWorker.RunWorkerAsync();
            }
        }
Exemple #5
0
        private void wizard_Load(object sender, EventArgs e)
        {
            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);

            if (!editor)
            {
                qualityComboBoxEX.SelectedIndex   = 0;
                itemTypeComboBoxEX.SelectedIndex  = 0;
                itemBindsComboBoxEX.SelectedIndex = 0;

                skillProfressionComboBoxEX.SelectedIndex = 0;

                //Test MySQL Connection

                wizardPage1.NextButtonEnabled = eWizardButtonState.False;

                MySQLConnProgressBarX.Enabled = true;
                MySQLConnProgressBarX.Visible = true;

                MySQLConnLabelX.Visible = true;

                MySQLConnBackgroundWorker.RunWorkerAsync();
            }
            else
            {
                //Get Item Information

                wizardPage1.NextButtonEnabled = eWizardButtonState.False;


                MySQLConnProgressBarX.Enabled = true;
                MySQLConnProgressBarX.Visible = true;

                MySQLConnLabelX.Visible = true;
                MySQLConnLabelX.Text    = "Getting Item Information...";

                itemInfoBackgroundWorker.RunWorkerAsync();
            }
        }
        private void SearchDisplayID_Load(object sender, EventArgs e)
        {
            itemsListBox.SelectedIndexChanged += new EventHandler(itemsListBox_SelectedIndexChanged);

            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);
        }
Exemple #7
0
        private void wizard_WizardPageChanging(object sender, WizardCancelPageChangeEventArgs e)
        {
            if (e.OldPage == TCMTypeWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                switch (localRemoteComboBoxEX.SelectedIndex)
                {
                case 0:
                    e.NewPage = localWizardPage;
                    break;

                case 1:
                    e.NewPage = raWizardPage;
                    break;
                }
            }
            else if (e.OldPage == raWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (hostTextBoxX.Text != String.Empty && portIntegerInput.Value != 0 && usernameTextBoxX.Text != String.Empty && passwordTextBoxX.Text != String.Empty)
                {
                    remoteAccess = true;
                }
                else
                {
                    e.Cancel = true;
                }
            }
            else if (e.OldPage == localWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (trinityFolderTextBoxX.Text == String.Empty)
                {
                    e.Cancel = true;
                }
                else
                {
                    e.NewPage = MySQLWizardPage;
                }
            }
            else if (e.OldPage == MySQLWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (MySQLHostTextBoxX.Text != String.Empty && MySQLIntegerInputX.Value != 0 && MySQLUsernameTextBoxX.Text != String.Empty && MySQLPasswordTextBoxX.Text != String.Empty)
                {
                    host     = MySQLHostTextBoxX.Text;
                    port     = MySQLIntegerInputX.Value;
                    username = MySQLUsernameTextBoxX.Text;
                    password = MySQLPasswordTextBoxX.Text;

                    MySQLTestConnectionProgressBarX.Visible = true;

                    mysql = new SQLMethods(host, port, username, password);

                    if (mysql != null)
                    {
                        bool MySQLTest = mysql.TestMySQLConnection();
                        Application.DoEvents();

                        MySQLTestConnectionProgressBarX.Visible = false;

                        if (MySQLTest)
                        {
                            switch (MySQLNewExistComboBoxEX.SelectedIndex)
                            {
                            case 0:     //New Database

                                e.NewPage = setupTCDBWizardPage;

                                break;

                            case 1:     //Existing Database

                                e.NewPage = ExistingTCDBWizardPage;

                                break;
                            }
                        }
                        else
                        {
                            e.Cancel = true;

                            TaskDialog.Show(new TaskDialogInfo("Error", eTaskDialogIcon.Stop, "An error has occured!", "Could not connect to MySQL!", eTaskDialogButton.Ok));
                        }
                    }
                }
                else
                {
                    e.Cancel = true;
                }
            }
            else if ((e.OldPage == localWizardPage || e.OldPage == raWizardPage) && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (MySQLHostTextBoxX.Text == String.Empty || portIntegerInput.Value == 0 || MySQLUsernameTextBoxX.Text == String.Empty || MySQLPasswordTextBoxX.Text == String.Empty)
                {
                    e.Cancel = true;
                }
            }
            else if (e.OldPage == setupTCDBWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (remoteAccess)
                {
                    e.NewPage = finishedWizardPage;
                }
                else
                {
                    e.NewPage = otherWizardPage;
                }
            }
            else if (e.OldPage == ExistingTCDBWizardPage && e.PageChangeSource == eWizardPageChangeSource.NextButton)
            {
                if (MySQLAuthDBTextBoxX.Text == String.Empty || MySQLCharDBTextBoxX.Text == String.Empty || MySQLWorldDBTextBoxX.Text == String.Empty)
                {
                    e.Cancel = true;
                }
                else
                {
                    aDB = MySQLAuthDBTextBoxX.Text;
                    cDB = MySQLCharDBTextBoxX.Text;
                    wDB = MySQLWorldDBTextBoxX.Text;

                    if (remoteAccess)
                    {
                        e.NewPage = finishedWizardPage;
                    }
                    else
                    {
                        e.NewPage = otherWizardPage;
                    }
                }
            }


            if (e.NewPage == setupTCDBWizardPage)
            {
                setupTCDBWizardPage.NextButtonEnabled = eWizardButtonState.False;
            }
        }
 private void SearchNPCID_Load(object sender, EventArgs e)
 {
     mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);
 }
Exemple #9
0
        private void SendMail_Load(object sender, EventArgs e)
        {
            mysql = new SQLMethods(Settings.Default.MySQLHost, Settings.Default.MySQLPort, Settings.Default.MySQLUsername, Settings.Default.MySQLPassword);

            mysqlBackgroundWorker.RunWorkerAsync();
        }