Exemple #1
0
        private void buttonImportLocal_Click(object sender, EventArgs e)
        {
            if (textBoxImportPathLocal.Text != "")
            {
                //save settings
                Properties.Settings.Default.LocalDBFile     = textBoxLocalDBPath.Text;
                Properties.Settings.Default.ImportPathLocal = textBoxImportPathLocal.Text;
                Properties.Settings.Default.Save();

                //read files
                List <XbmcFile> files = XMLConnector.ReadFiles(textBoxImportPathLocal.Text);

                if (files != null)
                {
                    disableButtons();

                    //run import in different thread
                    XbmcSqlLiteConnector sql = new XbmcSqlLiteConnector(textBoxLocalDBPath.Text, files);
                    toolStripProgressBar1.Style = ProgressBarStyle.Marquee; //turn on the progress bar
                    backgroundWorkerImportLocal.RunWorkerAsync(sql);
                }
            }
            else
            {
                MessageBox.Show("Please select a file.");
            }
        }
Exemple #2
0
        private void buttonImportRemote_Click(object sender, EventArgs e)
        {
            if (textBoxImportPathRemote.Text != "")
            {
                //save settings
                Properties.Settings.Default.ServerIP         = textBoxServerIP.Text;
                Properties.Settings.Default.Username         = textBoxUsername.Text;
                Properties.Settings.Default.Password         = textBoxPassword.Text;
                Properties.Settings.Default.ImportPathRemote = textBoxImportPathRemote.Text;
                Properties.Settings.Default.DatabaseName     = textBoxDatabaseName.Text;
                Properties.Settings.Default.Save();

                //read files
                List <XbmcFile> files = XMLConnector.ReadFiles(textBoxImportPathRemote.Text);

                if (files != null)
                {
                    disableButtons();

                    //run import in different thread
                    XbmcMySqlConnector sql = new XbmcMySqlConnector(textBoxServerIP.Text, textBoxUsername.Text, textBoxPassword.Text, files);
                    toolStripProgressBar1.Style = ProgressBarStyle.Marquee; //turn on the progress bar
                    backgroundWorkerImportRemote.RunWorkerAsync(sql);
                }
            }
            else
            {
                MessageBox.Show("Please select a file.");
            }
        }