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; } }
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; } }
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 (xPomElementsMappingPageFrame.Content == null) // InitilizePomElementsMappingPage(); if (pomAllElementsPage.mAgent == null) { pomAllElementsPage.SetAgent(mWizard.Agent); } if (mWizard.ManualElementConfiguration) { xReLearnButton.Visibility = Visibility.Hidden; pomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear(); } else { pomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Clear(); pomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Add(ucGrid.eUcGridValidationRules.CantBeEmpty); xReLearnButton.Visibility = Visibility.Visible; mWizard.IWindowExplorerDriver.UnHighLightElements(); mWizard.ScreenShot = ((IVisualTestingDriver)mWizard.Agent.Driver).GetScreenShot(); mSelectedElementTypesList = mWizard.AutoMapElementTypesList.Where(x => x.Selected == true).Select(x => x.ElementType).ToList(); Learn(); } break; } }