Beispiel #1
0
        /// <summary>
        /// Allows to refresh the comparison results
        /// </summary>
        /// <param name="cancellable">TRUE means that the user will be allowed to cancel
        /// the comparison process. FALSE prevents this from happening (by making the CANCEL
        /// button disabled).</param>
        private void RefreshComparison(bool cancellable)
        {
            CompareWorker  worker = new CompareWorker(_compareParams);
            ProgressDialog pdlg   = new ProgressDialog();

            if (cancellable)
            {
                pdlg.Start(this, worker);
            }
            else
            {
                pdlg.StartNonCancellable(this, worker);
            }

            Dictionary <SchemaObject, List <SchemaComparisonItem> > results =
                (Dictionary <SchemaObject, List <SchemaComparisonItem> >)pdlg.Result;

            if (results != null)
            {
                // Create the schema comparison view and populate it with the results
                if (_schemaView == null)
                {
                    _schemaView           = new SchemaComparisonView();
                    _schemaView.BackColor = SystemColors.Control;
                    pnlContents.Controls.Add(_schemaView);
                    _schemaView.Dock              = DockStyle.Fill;
                    _schemaView.SelectionChanged += new EventHandler(_schemaView_SelectionChanged);
                }

                _leftSchema  = worker.LeftSchema;
                _rightSchema = worker.RightSchema;
                _results     = results;
                _leftdb      = _compareParams.LeftDbPath;
                _rightdb     = _compareParams.RightDbPath;

                _schemaView.ShowComparisonResults(results, _compareParams.LeftDbPath, _compareParams.RightDbPath,
                                                  worker.LeftSchema, worker.RightSchema, _compareParams.ComparisonType == ComparisonType.CompareSchemaAndData);
            }

            UpdateState();
        }
 /// <summary>
 /// Starts the dialog in a mode that does not allow the user to cancel
 /// the operation.
 /// </summary>
 /// <param name="parent">The parent form</param>
 /// <param name="worker">The worker object to start.</param>
 public void StartNonCancellable(IWin32Window parent, CompareWorker worker)
 {
     btnCancel.Enabled = false;
     Start(parent, worker);
 }