Exemplo n.º 1
0
        public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            switch (WizardEventArgs.EventType)
            {
            case EventType.Init:
                mWizard = (AddPOMWizard)WizardEventArgs.Wizard;
                if (!mWizard.ManualElementConfiguration)
                {
                    mElementsList.CollectionChanged += ElementsListCollectionChanged;
                    InitilizePomElementsMappingPage();
                }
                break;

            case EventType.Active:
                if (mPomAllElementsPage.mAgent == null)
                {
                    mPomAllElementsPage.SetAgent(mWizard.Agent);
                }

                if (mWizard.ManualElementConfiguration)
                {
                    xReLearnButton.Visibility = Visibility.Hidden;
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear();
                }
                else
                {
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear();
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Add(ucGrid.eUcGridValidationRules.CantBeEmpty);

                    xReLearnButton.Visibility = Visibility.Visible;

                    mSelectedElementTypesList = mWizard.AutoMapElementTypesList.Where(x => x.Selected == true).Select(x => x.ElementType).ToList();
                    Learn();
                }
                break;

            case EventType.LeavingForNextPage:
            case EventType.Finish:
                mPomAllElementsPage.FinishEditInAllGrids();
                if (mPomAllElementsPage != null)
                {
                    mPomAllElementsPage.StopSpy();
                }
                ResetDriverStopProcess();
                break;

            case EventType.Cancel:
                if (mPomAllElementsPage != null)
                {
                    mPomAllElementsPage.StopSpy();
                }
                ResetDriverStopProcess();

                break;
            }
        }
Exemplo n.º 2
0
        public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            switch (WizardEventArgs.EventType)
            {
            case EventType.Init:
                mWizard = (AddPOMWizard)WizardEventArgs.Wizard;
                if (!mWizard.ManualElementConfiguration)
                {
                    InitilizePomElementsMappingPage();
                }
                break;

            case EventType.Active:
                if (mPomAllElementsPage.mAgent == null)
                {
                    mPomAllElementsPage.SetAgent(mWizard.mPomLearnUtils.Agent);
                }

                if (mWizard.ManualElementConfiguration)
                {
                    xReLearnButton.Visibility = Visibility.Hidden;
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear();
                }
                else
                {
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear();
                    mPomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Add(ucGrid.eUcGridValidationRules.CantBeEmpty);

                    xReLearnButton.Visibility = Visibility.Visible;

                    Learn();
                }
                break;

            case EventType.LeavingForNextPage:
            case EventType.Finish:
                mPomAllElementsPage.FinishEditInAllGrids();
                if (mPomAllElementsPage != null)
                {
                    mPomAllElementsPage.StopSpy();
                }
                mWizard.mPomLearnUtils.ClearStopLearning();
                break;

            case EventType.Cancel:
                if (mPomAllElementsPage != null)
                {
                    mPomAllElementsPage.StopSpy();
                }
                mWizard.mPomLearnUtils.ClearStopLearning();
                break;
            }
        }