Ejemplo n.º 1
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.");
            }
        }
Ejemplo n.º 2
0
        private void backgroundWorkerImportRemote_DoWork(object sender, DoWorkEventArgs e)
        {
            //cast the connector then execute import command
            XbmcMySqlConnector sql = (XbmcMySqlConnector)e.Argument;

            e.Result = sql.ImportWatchedFlags().ToString();
            //MessageBox.Show("Import complete. " + sql.ImportWatchedFlags().ToString() + " rows updated.");
        }
Ejemplo n.º 3
0
        private void backgroundWorkerExportRemote_DoWork(object sender, DoWorkEventArgs e)
        {
            //cast the connector then execute export command
            XbmcMySqlConnector sql   = (XbmcMySqlConnector)e.Argument;
            List <XbmcFile>    files = sql.ExportWatchedFlags();

            files.Sort();
            XMLConnector.WriteFiles(textBoxExportPathRemote.Text, files);
            e.Result = files.Count;
            //MessageBox.Show("Export complete. " + files.Count + " files found.");
        }