public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            switch (WizardEventArgs.EventType)
            {
            case EventType.Init:
                mWizard = (AddPOMWizard)WizardEventArgs.Wizard;
                xNameTextBox.BindControl(mWizard.mPomLearnUtils.POM, nameof(ApplicationPOMModel.Name));
                xNameTextBox.AddValidationRule(new POMNameValidationRule());
                xNameTextBox.Focus();

                xURLTextBox.BindControl(mWizard.mPomLearnUtils.POM, nameof(ApplicationPOMModel.PageURL));

                xDescriptionTextBox.BindControl(mWizard.mPomLearnUtils.POM, nameof(ApplicationPOMModel.Description));
                xTagsViewer.Init(mWizard.mPomLearnUtils.POM.TagsKeys);

                mBusinessFlowControl = new ucBusinessFlowMap(mWizard.mPomLearnUtils.POM, nameof(mWizard.mPomLearnUtils.POM.MappedBusinessFlow), false);
                xFrameBusinessFlowControl.Content = mBusinessFlowControl;
                break;

            case EventType.Active:
                SetDefaultPage();
                ShowScreenShot();
                if (mWizard.ManualElementConfiguration)
                {
                    xTakeScreenShotLoadButton.Visibility = Visibility.Collapsed;
                }
                else
                {
                    xTakeScreenShotLoadButton.Visibility = Visibility.Visible;
                }
                break;
            }
        }
Exemple #2
0
        public POMEditPage(ApplicationPOMModel POM, eRIPageViewMode editMode = eRIPageViewMode.View)
        {
            InitializeComponent();
            mPOM      = POM;
            mEditMode = editMode;

            mBusinessFlowControl = new ucBusinessFlowMap(mPOM, nameof(mPOM.MappedBusinessFlow));
            xFrameBusinessFlowControl.Content = mBusinessFlowControl;

            xShowIDUC.Init(mPOM);
            xFirstRowExpanderLabel.Content = string.Format("'{0}' Details", mPOM.Name);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xNameTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Name));
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xDescriptionTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Description));
            xPageURLTextBox.Init(null, mPOM, nameof(mPOM.PageURL));

            FillTargetAppsComboBox();
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xTargetApplicationComboBox, ComboBox.SelectedValueProperty, mPOM, nameof(ApplicationPOMModel.TargetApplicationKey));
            xTagsViewer.Init(mPOM.TagsKeys);

            BitmapSource source = null;

            if (mPOM.ScreenShotImage != null)
            {
                source = Ginger.General.GetImageStream(Ginger.General.Base64StringToImage(mPOM.ScreenShotImage.ToString()));
            }

            mScreenShotViewPage      = new ScreenShotViewPage(mPOM.Name, source);
            xScreenShotFrame.Content = mScreenShotViewPage;

            mPomAllElementsPage      = new PomAllElementsPage(mPOM, PomAllElementsPage.eAllElementsPageContext.POMEditPage);
            xUIElementsFrame.Content = mPomAllElementsPage;

            mPomAllElementsPage.raiseUIElementsCountUpdated += UIElementCountUpdatedHandler;
            UIElementTabTextBlockUpdate();

            mAppPlatform = WorkSpace.Instance.Solution.GetTargetApplicationPlatform(POM.TargetApplicationKey);
            ObservableList <Agent> optionalAgentsList = GingerCore.General.ConvertListToObservableList((from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Agent>() where x.Platform == mAppPlatform select x).ToList());

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xAgentControlUC, ucAgentControl.SelectedAgentProperty, this, nameof(Agent));
            xAgentControlUC.Init(optionalAgentsList, mPOM.LastUsedAgent);

            SetDefaultPage();
        }