예제 #1
0
        public ActivitiesGroupPage(ActivitiesGroup activitiesGroup, BusinessFlow parentBusinessFlow = null, eEditMode mode = eEditMode.ExecutionFlow)
        {
            InitializeComponent();
            mEditMode        = mode;
            mActivitiesGroup = activitiesGroup;
            mActivitiesGroup.SaveBackup();
            mBusinessFlow = parentBusinessFlow;

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtGroupName, TextBox.TextProperty, mActivitiesGroup, nameof(ActivitiesGroup.Name));
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtGroupDescription, TextBox.TextProperty, mActivitiesGroup, nameof(ActivitiesGroup.Description));
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtAutoPrecentage, TextBox.TextProperty, mActivitiesGroup, nameof(ActivitiesGroup.AutomationPrecentage), BindingMode.OneWay);

            SetGroupedActivitiesGridView();
            grdGroupedActivities.DataSourceList = mActivitiesGroup.ActivitiesIdentifiers;
            grdGroupedActivities.btnRefresh.AddHandler(Button.ClickEvent, new RoutedEventHandler(RefreshGroupedActivities));
            AttachActivitiesGroupAndRepositoryActivities();
            RefreshGroupedActivities();

            TagsViewer.Init(mActivitiesGroup.Tags);

            if (mEditMode == eEditMode.ExecutionFlow)
            {
                SharedRepoInstanceUC.Init(mActivitiesGroup, mBusinessFlow);
            }
            else
            {
                SharedRepoInstanceUC.Visibility = Visibility.Collapsed;
                SharedRepoInstanceUC_Col.Width  = new GridLength(0);
            }
        }
예제 #2
0
        public AgentEditPage(Agent agent)
        {
            InitializeComponent();

            if (agent != null)
            {
                mAgent = agent;
                mOriginalPlatformType = mAgent.Platform;
                mOriginalDriverType   = mAgent.DriverType.ToString();

                App.ObjFieldBinding(AgentNameTextBox, TextBox.TextProperty, mAgent, Agent.Fields.Name);
                txtPlatformType.Text = mOriginalPlatformType.ToString();

                App.ObjFieldBinding(NotesTextBox, TextBox.TextProperty, mAgent, Agent.Fields.Notes);

                // Remote Agent config
                //App.ObjFieldBinding(HostTextBox, TextBox.TextProperty, mAgent, Agent.Fields.Host);
                //App.ObjFieldBinding(PortTextBox, TextBox.TextProperty, mAgent, Agent.Fields.Port);
                //App.ObjFieldBinding(RemoteCheckBox, CheckBox.IsCheckedProperty, mAgent, Agent.Fields.Remote);

                TagsViewer.Init(mAgent.Tags);

                SetDriverTypeCombo();
                App.ObjFieldBinding(driverTypeComboBox, ComboBox.TextProperty, mAgent, Agent.Fields.DriverType);

                driverTypeComboBox.SelectionChanged += driverTypeComboBox_SelectionChanged;

                DriverConfigFrmae.SetContent(new AgentDriverConfigPage(mAgent));
            }
        }
예제 #3
0
        public VariableEditPage(VariableBase v, Context context, bool setGeneralConfigsAsReadOnly = false, eEditMode mode = eEditMode.BusinessFlow, RepositoryItemBase parent = null)
        {
            InitializeComponent();

            this.Title = "Edit " + GingerDicser.GetTermResValue(eTermResKey.Variable);
            mVariable  = v;
            mVariable.SaveBackup();
            editMode = mode;
            mParent  = parent;
            mContext = context;
            App.ObjFieldBinding(txtVarName, TextBox.TextProperty, mVariable, nameof(VariableBase.Name));
            App.ObjFieldBinding(txtVarDescritpion, TextBox.TextProperty, mVariable, nameof(VariableBase.Description));
            App.ObjFieldBinding(txtFormula, TextBox.TextProperty, mVariable, nameof(VariableBase.Formula), BindingMode.OneWay);
            App.ObjFieldBinding(txtCurrentValue, TextBox.TextProperty, mVariable, nameof(VariableBase.Value), BindingMode.OneWay);
            App.ObjFieldBinding(cbSetAsInputValue, CheckBox.IsCheckedProperty, mVariable, nameof(VariableBase.SetAsInputValue));
            App.ObjFieldBinding(cbSetAsOutputValue, CheckBox.IsCheckedProperty, mVariable, nameof(VariableBase.SetAsOutputValue));

            if (mode == eEditMode.Global)
            {
                cbSetAsInputValue.Visibility  = Visibility.Hidden;
                cbSetAsOutputValue.Visibility = Visibility.Hidden;
            }
            else
            {
                cbSetAsInputValue.Visibility  = Visibility.Visible;
                cbSetAsOutputValue.Visibility = Visibility.Visible;
            }
            if (setGeneralConfigsAsReadOnly)
            {
                txtVarName.IsReadOnly        = true;
                txtVarDescritpion.IsReadOnly = true;
                cbSetAsInputValue.IsEnabled  = false;
                cbSetAsOutputValue.IsEnabled = false;
            }

            mVariable.PropertyChanged += mVariable_PropertyChanged;
            LoadVarPage();

            SetLinkedVarCombo();

            if (mVariable.Tags == null)
            {
                mVariable.Tags = new ObservableList <Guid>();
            }
            TagsViewer.Init(mVariable.Tags);

            if (editMode == eEditMode.BusinessFlow || editMode == eEditMode.Activity)
            {
                if (mContext != null && mContext.BusinessFlow != null)
                {
                    SharedRepoInstanceUC.Init(mVariable, mContext.BusinessFlow);
                }
            }
            else
            {
                SharedRepoInstanceUC.Visibility = Visibility.Collapsed;
                SharedRepoInstanceUC_Col.Width  = new GridLength(0);
            }
        }
예제 #4
0
        public AppsListPage(ProjEnvironment env)
        {
            InitializeComponent();

            AppEnvironmnet = env;
            //Set grid look and data
            SetGridView();
            SetGridData();

            App.ObjFieldBinding(EnvNameTextBox, TextBox.TextProperty, env, ProjEnvironment.Fields.Name);

            grdApps.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddApp));
            grdApps.AddToolbarTool("@Share_16x16.png", "Add Selected Applications to All Environments", new RoutedEventHandler(AddAppsToOtherEnvironments));

            TagsViewer.Init(AppEnvironmnet.Tags);
        }
        public AgentEditPage(Agent agent)
        {
            InitializeComponent();

            if (agent != null)
            {
                mAgent = agent;

                xShowIDUC.Init(mAgent);
                GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xAgentNameTextBox, TextBox.TextProperty, mAgent, nameof(Agent.Name));
                GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xDescriptionTextBox, TextBox.TextProperty, mAgent, nameof(Agent.Notes));
                GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xAgentTypelbl, Label.ContentProperty, mAgent, nameof(Agent.AgentType));
                BindingHandler.ObjFieldBinding(xPublishcheckbox, CheckBox.IsCheckedProperty, mAgent, nameof(RepositoryItemBase.Publish));
                TagsViewer.Init(mAgent.Tags);

                if (mAgent.AgentType == eAgentType.Driver)
                {
                    mOriginalPlatformType = mAgent.Platform;
                    mOriginalDriverType   = mAgent.DriverType.ToString();

                    xPlatformTxtBox.Text = mOriginalPlatformType.ToString();
                    SetDriverInformation();
                    GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xDriverTypeComboBox, ComboBox.TextProperty, mAgent, nameof(Agent.DriverType));
                    xDriverTypeComboBox.SelectionChanged += driverTypeComboBox_SelectionChanged;
                }
                else//Plugin
                {
                    xDriverConfigPnl.Visibility = Visibility.Collapsed;
                    xPluginConfigPnl.Visibility = Visibility.Visible;

                    // Plugin combo
                    xPluginIdComboBox.ItemsSource       = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <PluginPackage>();
                    xPluginIdComboBox.DisplayMemberPath = nameof(PluginPackage.PluginId);
                    xPluginIdComboBox.BindControl(mAgent, nameof(Agent.PluginId));
                }
                if (mAgent.AgentType == eAgentType.Driver)
                {
                    xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent));
                }
                else
                {
                    // xAgentConfigFrame.SetContent(new NewAgentDriverConfigPage(mAgent));
                    xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent));
                }
            }
        }
예제 #6
0
        public AppsListPage(ProjEnvironment env)
        {
            InitializeComponent();

            AppEnvironmnet = env;
            //Set grid look and data
            SetGridView();
            SetGridData();

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(EnvNameTextBox, TextBox.TextProperty, env, ProjEnvironment.Fields.Name);
            xShowIDUC.Init(AppEnvironmnet);
            BindingHandler.ObjFieldBinding(xPublishcheckbox, CheckBox.IsCheckedProperty, AppEnvironmnet, nameof(RepositoryItemBase.Publish));


            grdApps.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddApp));
            grdApps.AddToolbarTool("@Share_16x16.png", "Add Selected Applications to All Environments", new RoutedEventHandler(AddAppsToOtherEnvironments));

            TagsViewer.Init(AppEnvironmnet.Tags);
        }
예제 #7
0
        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;
            }
        }
예제 #8
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();
        }