/**************************************************************************/

        public void SetDataExtractor()
        {
            int Max = this.DataExtractor.GetSize();

            for (int Slot = 0; Slot < Max; Slot++)
            {
                ComboBox StateComboBox;
                TextBox  TextBoxLabel;
                TextBox  TextBoxExpression;

                StateComboBox = this.Controls.Find(
                    string.Format("StateComboBox{0}", Slot + 1),
                    true
                    ).FirstOrDefault() as ComboBox;

                TextBoxLabel = this.Controls.Find(
                    string.Format("TextBoxLabel{0}", Slot + 1),
                    true
                    ).FirstOrDefault() as TextBox;

                TextBoxExpression = this.Controls.Find(
                    string.Format("TextBoxExpression{0}", Slot + 1),
                    true
                    ).FirstOrDefault() as TextBox;

                if (this.DataExtractor.IsEnabled())
                {
                    MacroscopeConstants.ActiveInactive State = this.DataExtractor.GetActiveInactive(Slot: Slot);

                    switch (State)
                    {
                    case MacroscopeConstants.ActiveInactive.ACTIVE:
                        StateComboBox.SelectedIndex = 1;
                        break;

                    default:
                        StateComboBox.SelectedIndex = 0;
                        break;
                    }

                    TextBoxLabel.Text = this.DataExtractor.GetLabel(Slot: Slot);

                    TextBoxExpression.Text = this.DataExtractor.GetRegex(Slot: Slot).ToString();

                    if (
                        string.IsNullOrEmpty(TextBoxLabel.Text) ||
                        string.IsNullOrEmpty(TextBoxExpression.Text))
                    {
                        StateComboBox.SelectedIndex = 0;
                    }
                }
                else
                {
                    StateComboBox.SelectedIndex = 0;
                    TextBoxLabel.Text           = "";
                    TextBoxExpression.Text      = "";
                }
            }
        }
Exemplo n.º 2
0
        /**************************************************************************/

        public void SetActiveInactive(int Slot, MacroscopeConstants.ActiveInactive State)
        {
            this.ExtractActiveInactive[Slot] = State;
        }