Exemplo n.º 1
0
        public Page GetConfigPage(List <ElementConfigControl> configControlsList)
        {
            StackPanel dynamicPanel = new StackPanel {
                Orientation = Orientation.Horizontal
            };

            UserControlsLib.UCComboBox comboBox;
            Label elementLabel;
            Page  dynamicPage = new Page();

            foreach (ElementConfigControl element in configControlsList)
            {
                if (element.ControlType == eElementType.ComboBox)
                {
                    elementLabel = new Label()
                    {
                        Content             = element.Title,
                        HorizontalAlignment = HorizontalAlignment.Left,
                        FontSize            = 14
                    };
                    comboBox = new UserControlsLib.UCComboBox()
                    {
                        Name   = element.Title,
                        Width  = 245,
                        Margin = new Thickness(99, 20, 20, 10)
                    };

                    comboBox.Init(mAction.GetOrCreateInputParam(element.BindedString), isVENeeded: true);
                    ((Ginger.UserControlsLib.UCComboBox)comboBox).ComboBox.ItemsSource = element.PossibleValues;

                    dynamicPanel.Children.Add(elementLabel);
                    dynamicPanel.Children.Add(comboBox);
                }
                else if (element.ControlType == eElementType.TextBox)
                {
                    elementLabel = new Label()
                    {
                        Content             = element.Title,
                        HorizontalAlignment = HorizontalAlignment.Left,
                        FontSize            = 14
                    };
                    Ginger.Actions.UCValueExpression txtBox = new Ginger.Actions.UCValueExpression()
                    {
                        Name   = element.Title.ToString().Replace(" ", ""),
                        Width  = 245,
                        Margin = new Thickness(99, 20, 20, 10)
                    };

                    txtBox.Init(mAction.GetOrCreateInputParam(element.BindedString), isVENeeded: true);
                    ((Ginger.Actions.UCValueExpression)txtBox).ValueTextBox.Text = element.PossibleValues.ElementAt(0);
                    dynamicPanel.Children.Add(elementLabel);
                    dynamicPanel.Children.Add(txtBox);
                }
            }
            dynamicPage.Content = dynamicPanel;
            return(dynamicPage);
        }
Exemplo n.º 2
0
        private Page GetControlActionValue()
        {
            Page       getControlActionValuePage = new Page();
            StackPanel controlActionPanel        = new StackPanel();

            if (ControlActionComboBox.ComboBox.SelectedItem != null && ControlActionComboBox.ComboBox.SelectedValue != null)
            {
                if (ControlActionComboBox.ComboBox.SelectedValue.ToString() == ActUIElement.eElementAction.SetValue.ToString() || ControlActionComboBox.ComboBox.SelectedValue.ToString() == ActUIElement.eElementAction.SetText.ToString() ||
                    ControlActionComboBox.ComboBox.SelectedValue.ToString() == ActUIElement.eElementAction.SendKeyPressRelease.ToString())
                {
                    Ginger.Actions.UCValueExpression textboxControlAction = new Ginger.Actions.UCValueExpression()
                    {
                        Name  = "TableControlActionValue",
                        Width = 180
                    };

                    textboxControlAction.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActUIElement.Fields.ControlActionValue), isVENeeded: true);
                    controlActionPanel.Children.Add(textboxControlAction);
                    getControlActionValuePage.Content = controlActionPanel;
                }
            }
            return(getControlActionValuePage);
        }
Exemplo n.º 3
0
        public AgentConfigControl(DriverConfigParam Config)
        {
            InitializeComponent();
            Name.Content        = Config.Parameter;
            Description.Content = Config.Description;


            if (Config.OptionalValues == null || Config.OptionalValues.Count == 0)
            {
                Ginger.Actions.UCValueExpression txtBox = new Ginger.Actions.UCValueExpression()
                {
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Width = 600
                };

                txtBox.Visibility = Visibility.Visible;
                txtBox.Init(null, Config, "Value", isVENeeded: true);
                ControlPanel.Children.Add(txtBox);
            }
            else
            {
                ComboBox comboBox = new ComboBox()
                {
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Visibility          = Visibility.Visible,
                    Width  = 600,
                    Margin = new Thickness(10, 0, 0, 0)
                };
                //   comboBox.Init(Config, "Value");
                // ((Ginger.UserControlsLib.UCComboBox)comboBox).ComboBox.ItemsSource = Config.OptionalValues;
                ControlPanel.Children.Add(comboBox);
                ControlPanel.UpdateLayout();
            }
        }
Exemplo n.º 4
0
        public Page GetConfigPage(List <ElementConfigControl> configControlsList)
        {
            StackPanel dynamicPanel = new StackPanel {
                Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center
            };

            UserControlsLib.UCComboBox comboBox;
            Label elementLabel;
            Page  dynamicPage = new Page();

            foreach (ElementConfigControl element in configControlsList)
            {
                if (element.ControlType == eElementType.ComboBox)
                {
                    elementLabel = new Label()
                    {
                        Style               = this.FindResource("$LabelStyle") as Style,
                        Content             = element.Title + ":",
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Center,
                        FontSize            = 14
                    };
                    comboBox = new UserControlsLib.UCComboBox()
                    {
                        Name = element.Title,
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Center,
                        Width  = 600,
                        Margin = new Thickness(10, 0, 0, 0)
                    };
                    comboBox.Init(mAction.GetOrCreateInputParam(element.BindedString), isVENeeded: true);
                    ((Ginger.UserControlsLib.UCComboBox)comboBox).ComboBox.ItemsSource = element.PossibleValues;
                    if (mAction.ElementLocateBy == eLocateBy.POMElement)
                    {
                        ((Ginger.UserControlsLib.UCComboBox)comboBox).ComboBox.SelectedValue = element.DefaultValue;
                        comboBox.ComboBoxObject.Style = this.FindResource("$FlatEditInputComboBoxStyle") as Style;
                    }
                    dynamicPanel.Children.Add(elementLabel);
                    dynamicPanel.Children.Add(comboBox);
                }
                else if (element.ControlType == eElementType.TextBox)
                {
                    elementLabel = new Label()
                    {
                        Style               = this.FindResource("$LabelStyle") as Style,
                        Content             = element.Title + ":",
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Center,
                        FontSize            = 14
                    };
                    Ginger.Actions.UCValueExpression txtBox = new Ginger.Actions.UCValueExpression()
                    {
                        Name = element.Title.ToString().Replace(" ", ""),
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Center,
                        Width  = 600,
                        Margin = new Thickness(10, 0, 0, 0)
                    };

                    txtBox.Init(mAction.GetOrCreateInputParam(element.BindedString), isVENeeded: true);
                    ((Ginger.Actions.UCValueExpression)txtBox).ValueTextBox.Text = element.PossibleValues.ElementAt(0);
                    dynamicPanel.Children.Add(elementLabel);
                    dynamicPanel.Children.Add(txtBox);
                }
            }
            dynamicPage.Content = dynamicPanel;
            return(dynamicPage);
        }