Beispiel #1
0
        public void StartChecking(ICheckable checkable)
        {
            lock (oTaskLock)
            {
                //if there is already a Task and it has not completed
                if (_checkTask != null && !_checkTask.IsCompleted)
                {
                    return;
                }

                dialog = new YesNoYesToAllDialog();

                //else start a new Task
                Reset();
                _checkTask = new Task(() =>
                {
                    try
                    {
                        checkable.Check(this);
                    }
                    catch (Exception ex)
                    {
                        Fatal(new Exception("Entire Checking Process Failed", ex));
                    }
                }
                                      );
                _checkTask.Start();
            }
        }
Beispiel #2
0
        public static bool ShowYesNoMessageBoxToApplyFix(YesNoYesToAllDialog dialog, string problem, string proposedChange)
        {
            string message = "The following configuration problem was detected:" + Environment.NewLine + "\"" + problem + "\"" + Environment.NewLine;

            message += Environment.NewLine;
            message += " The proposed fix is to:" + Environment.NewLine + "\"" + proposedChange + "\"" + Environment.NewLine;
            message += Environment.NewLine;
            message += "Would you like to apply this fix?";

            if (dialog == null)
            {
                return(MessageBox.Show(message, "Apply Fix?", MessageBoxButtons.YesNo) == DialogResult.Yes);
            }

            return(dialog.ShowDialog(message, "Apply Fix?") == DialogResult.Yes);
        }
Beispiel #3
0
        public void StartChecking(ICheckable rootCheckable, bool bClearUI = true)
        {
            if (bClearUI)
            {
                yesNoYesToAllDialog = new YesNoYesToAllDialog();
            }

            if (CheckingInProgress)
            {
                MessageBox.Show("Checking already in progress, please wait for current checks to complete before requesting more");
                return;
            }

            if (bClearUI)
            {
                olvChecks.ClearObjects();
            }

            CheckingInProgress       = true;
            btnAbortChecking.Enabled = true;
            var listener = new ToMemoryCheckNotifier(this);

            _checkingThread = new Thread(() =>
            {
                try
                {
                    rootCheckable.Check(listener);
                    checker_AllChecksFinished(listener);
                }
                catch (Exception e)
                {
                    listener.OnCheckPerformed(new CheckEventArgs("Entire checking process crashed", CheckResult.Fail, e));
                    CheckingInProgress = false;

                    if (AllChecksComplete != null)
                    {
                        AllChecksComplete(this, new AllChecksCompleteHandlerArgs(listener));
                    }
                }
            });
            _checkingThread.Start();
        }
        public override void Execute()
        {
            base.Execute();

            //remove it from it's old container (really shouldn't be in any!)
            if (_sourceAggregateCommand.ContainerIfAny != null)
            {
                _sourceAggregateCommand.ContainerIfAny.RemoveChild(_sourceAggregateCommand.Aggregate);
            }

            var dialog = new YesNoYesToAllDialog();

            //remove any non IsExtractionIdentifier columns
            foreach (var dimension in _sourceAggregateCommand.Aggregate.AggregateDimensions)
            {
                if (!dimension.IsExtractionIdentifier)
                {
                    if (
                        dialog.ShowDialog(
                            "Changing to a CohortSet means deleting AggregateDimension '" + dimension + "'.  Ok?",
                            "Delete Aggregate Dimension") ==
                        DialogResult.Yes)
                    {
                        dimension.DeleteInDatabase();
                    }
                    else
                    {
                        return;
                    }
                }
            }

            //make it is no longer a joinable
            _sourceAggregateCommand.JoinableDeclarationIfAny.DeleteInDatabase();

            //add  it to the new container
            _targetCohortAggregateContainer.AddChild(_sourceAggregateCommand.Aggregate, 0);

            //refresh the entire configuration
            Publish(_sourceAggregateCommand.CohortIdentificationConfigurationIfAny);
        }
Beispiel #5
0
 public MakeChangePopup(YesNoYesToAllDialog dialog)
 {
     _dialog = dialog;
 }
Beispiel #6
0
 public void Clear()
 {
     olvChecks.ClearObjects();
     yesNoYesToAllDialog = new YesNoYesToAllDialog();
 }
Beispiel #7
0
 public ParameterRefactorer()
 {
     _yesNoToAll       = new YesNoYesToAllDialog();
     RefactoredFilters = new HashSet <IFilter>();
 }
Beispiel #8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            yesNoYesToAllDialog = new YesNoYesToAllDialog();
        }