Beispiel #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.");
            }
        }
Beispiel #2
0
        private void backgroundWorkerImportLocal_DoWork(object sender, DoWorkEventArgs e)
        {
            //cast the connector then execute import command
            XbmcSqlLiteConnector sql = (XbmcSqlLiteConnector)e.Argument;

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

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