Exemple #1
0
        private void backgroundWorkerPrepareTableSP_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            try
            {
                TableUtil.DropIndexOnTextKeys();
            }
            catch (Exception ex)
            { }

            while (!TableUtil.PreparedIsCompleteSP)
            {
                if (worker.CancellationPending)
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    // Perform a time consuming operation and report progress.
                    TableUtil.PrepareTextKeysSP();
                    worker.ReportProgress(100 * TableUtil.RowCountPreparedSP / TableUtil.RowCountForPrepareSP);
                }
            }
            if (TableUtil.PreparedIsCompleteSP)
            {
                worker.ReportProgress(100);
            }
        }