Beispiel #1
0
        public BusinessFlowRunConfigurationsPage(GingerRunner runner, BusinessFlow businessFlow, ObservableList <BusinessFlow> prevBusinessFlowsInFlow)
        {
            InitializeComponent();

            mWindowMode = eWindowMode.Configuration;

            mGingerRunner = runner;
            mBusinessFlow = businessFlow;
            mContext      = new Context()
            {
                BusinessFlow = businessFlow, Runner = runner
            };
            mPrevBusinessFlowsInFlow = prevBusinessFlowsInFlow;

            mBusinessFlow.SaveBackup();

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(MandatoryBusinessFlowCB, CheckBox.IsCheckedProperty, businessFlow, nameof(BusinessFlow.Mandatory), BindingMode.TwoWay);

            RunDescritpion.Init(mContext, businessFlow, nameof(BusinessFlow.RunDescription));

            grdVariables.btnEdit.AddHandler(Button.ClickEvent, new RoutedEventHandler(EditVar));
            grdVariables.AddToolbarTool("@Undo_16x16.png", "Reset " + GingerDicser.GetTermResValue(eTermResKey.Variables) + " to Original Configurations", new RoutedEventHandler(ResetBusFlowVariables));
            grdVariables.AddToolbarTool("@Share_16x16.png", "Share Selected " + GingerDicser.GetTermResValue(eTermResKey.Variables) + " Value to all Similar " + GingerDicser.GetTermResValue(eTermResKey.Variables) + " in " + GingerDicser.GetTermResValue(eTermResKey.RunSet), new RoutedEventHandler(CopyBusFlowVariables));
            grdVariables.RowDoubleClick += VariablesGrid_grdMain_MouseDoubleClick;

            SetVariablesGridView();
            LoadGridData();
            UpdateEditVariablesTabVisual();

            LoadBusinessFlowcontrols(businessFlow);
            UpdateFlowControlTabVisual();
            mBusinessFlow.BFFlowControls.CollectionChanged += BFFlowControls_CollectionChanged;
        }
        public BusinessFlowPage(BusinessFlow BizFlow, bool showMiniView = false, General.RepositoryItemPageViewMode editMode = General.RepositoryItemPageViewMode.SharedReposiotry)
        {
            InitializeComponent();

            mBusinessFlow = BizFlow;
            RunDescritpion.Init(BizFlow, BusinessFlow.Fields.RunDescription);
            mEditMode = editMode;
            LoadBizFlowData();
            App.PropertyChanged += AppPropertychanged;

            if (mBusinessFlow.TargetApplications == null)
            {
                mBusinessFlow.TargetApplications = new ObservableList <TargetApplication>();
            }
            PlatformListBox.ItemsSource       = mBusinessFlow.TargetApplications;
            PlatformListBox.DisplayMemberPath = nameof(TargetApplication.AppName);
            TagsViewer.Init(mBusinessFlow.Tags);

            TrackBusinessFlowAutomationPrecentage();
            mBusinessFlow.AttachActivitiesGroupsAndActivities();

            if (!showMiniView)
            {
                mActivitiesPage = new ActivitiesPage(mBusinessFlow, mEditMode);
                if (mEditMode != General.RepositoryItemPageViewMode.View)
                {
                    mActivitiesPage.grdActivities.ChangeGridView(eAutomatePageViewStyles.Design.ToString());
                    mBusinessFlow.SaveBackup();
                }
                mActivitiesPage.grdActivities.ShowTitle = System.Windows.Visibility.Collapsed;
                BfActivitiesFrame.Content = mActivitiesPage;

                mActivitiesGroupsPage = new ActivitiesGroupsPage(mBusinessFlow, mEditMode);
                mActivitiesGroupsPage.grdActivitiesGroups.ShowTitle = System.Windows.Visibility.Collapsed;
                BfActivitiesGroupsFrame.Content = mActivitiesGroupsPage;
                if (mBusinessFlow.ActivitiesGroups.Count == 0)
                {
                    ActivitiesGroupsExpander.IsExpanded = false;
                }

                mVariablesPage = new VariablesPage(GingerCore.Variables.eVariablesLevel.BusinessFlow, mBusinessFlow, mEditMode);
                mVariablesPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed;
                BfVariablesFrame.Content = mVariablesPage;
                if (mBusinessFlow.Variables.Count == 0)
                {
                    VariablesExpander.IsExpanded = false;
                }

                mReposiotryPage = new RepositoryPage(mBusinessFlow);
                mReposiotryPage.ShowActionsRepository   = System.Windows.Visibility.Collapsed;
                mReposiotryPage.ShowVariablesRepository = System.Windows.Visibility.Collapsed;
                RepositoryFrame.Content = mReposiotryPage;
            }
            else
            {
                //hide Variables / Activities groups/ Activities / Repository
                Row3.MinHeight = 0;
                Row3.Height    = new GridLength(0);
                Row4.MinHeight = 0;
                Row4.Height    = new GridLength(0);
                Row5.MinHeight = 0;
                Row5.Height    = new GridLength(0);
            }
            if (mEditMode == General.RepositoryItemPageViewMode.View)
            {
                txtName.IsEnabled            = false;
                txtDescription.IsEnabled     = false;
                RunDescritpion.IsEnabled     = false;
                TagsViewer.IsEnabled         = false;
                xBusinessflowinfo.IsEnabled  = false;
                xTargetApplication.IsEnabled = false;
                RepositoryExpander.IsEnabled = false;
                xAutomateBtn.Visibility      = Visibility.Collapsed;
            }

            if (!App.UserProfile.UserTypeHelper.IsSupportAutomate)
            {
                xAutomateBtn.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #3
0
        public ActivityEditPage(Activity activity, General.RepositoryItemPageViewMode mode = General.RepositoryItemPageViewMode.Automation, BusinessFlow activityParentBusinessFlow = null)
        {
            InitializeComponent();

            this.Title = "Edit " + GingerDicser.GetTermResValue(eTermResKey.Activity);

            mActivity = activity;
            if (editMode != General.RepositoryItemPageViewMode.View)
            {
                mActivity.SaveBackup();
            }
            editMode = mode;

            RunDescritpion.Init(activity, Activity.Fields.RunDescription);

            if (activityParentBusinessFlow != null)
            {
                mActivityParentBusinessFlow = activityParentBusinessFlow;
            }
            else
            {
                mActivityParentBusinessFlow = App.BusinessFlow;
            }

            List <string> automationStatusList = GingerCore.General.GetEnumValues(typeof(Activity.eActivityAutomationStatus));

            AutomationStatusCombo.ItemsSource = automationStatusList;
            RunOptionCombo.BindControl(activity, Activity.Fields.ActionRunOption);
            HandlerTypeCombo.ItemsSource = GingerCore.General.GetEnumValues(typeof(ErrorHandler.eHandlerType));

            App.FillComboFromEnumVal(cmbErrorHandlerMapping, mActivity.ErrorHandlerMappingType);
            App.ObjFieldBinding(txtActivityName, TextBox.TextProperty, mActivity, Activity.Fields.ActivityName);
            App.ObjFieldBinding(txtActivityDescription, TextBox.TextProperty, mActivity, Activity.Fields.Description);
            App.ObjFieldBinding(txtExpected, TextBox.TextProperty, mActivity, Activity.Fields.Expected);
            App.ObjFieldBinding(txtScreen, TextBox.TextProperty, mActivity, Activity.Fields.Screen);
            App.ObjFieldBinding(txtGroup, TextBox.TextProperty, mActivity, Activity.Fields.ActivitiesGroupID);
            App.ObjFieldBinding(AutomationStatusCombo, ComboBox.TextProperty, mActivity, Activity.Fields.AutomationStatus);
            App.ObjFieldBinding(MandatoryActivityCB, CheckBox.IsCheckedProperty, mActivity, Activity.Fields.Mandatory);

            if (activity.GetType() == typeof(ErrorHandler))
            {
                HandlerTypeStack.Visibility = Visibility.Visible;
                App.ObjFieldBinding(HandlerTypeCombo, ComboBox.TextProperty, mActivity, ErrorHandler.Fields.HandlerType);
            }
            else
            {
                App.ObjFieldBinding(cmbErrorHandlerMapping, ComboBox.SelectedValueProperty, mActivity, Activity.Fields.ErrorHandlerMappingType);
                HandlerMappingStack.Visibility = Visibility.Visible;
                Row1.Height = new GridLength(Row1.Height.Value - 38);
            }

            App.ObjFieldBinding(TargetApplicationComboBox, ComboBox.SelectedValueProperty, mActivity, Activity.Fields.TargetApplication);

            FillTargetAppsComboBox();

            TagsViewer.Init(mActivity.Tags);

            VariablesPage varbsPage;
            ActionsPage   actionsPage;

            if (editMode == General.RepositoryItemPageViewMode.View)
            {
                varbsPage   = new VariablesPage(eVariablesLevel.Activity, mActivity, General.RepositoryItemPageViewMode.View);
                actionsPage = new ActionsPage(mActivity, General.RepositoryItemPageViewMode.View);
                SetViewMode();
            }
            else
            {
                varbsPage   = new VariablesPage(eVariablesLevel.Activity, mActivity);
                actionsPage = new ActionsPage(mActivity);
            }
            varbsPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed;
            if (varbsPage.grdVariables.Grid.Items.Count == 0)
            {
                VariablesExpander.IsExpanded = false;
            }

            actionsPage.grdActions.ShowTitle = System.Windows.Visibility.Collapsed;
            VariablesFrame.Content           = varbsPage;
            ActionsFrame.Content             = actionsPage;

            if (editMode == General.RepositoryItemPageViewMode.Automation)
            {
                SharedRepoInstanceUC.Init(mActivity, mActivityParentBusinessFlow);
            }
            else
            {
                SharedRepoInstanceUC.Visibility = Visibility.Collapsed;
                SharedRepoInstanceUC_Col.Width  = new GridLength(0);
            }
            if (!mActivity.IsNotGherkinOptimizedActivity)
            {
                txtActivityName.IsEnabled = false;
            }

            txtActivityName.Focus();
        }