Пример #1
0
        /// <summary>
        /// Parametrized Constructor for Edit functionality.
        /// </summary>
        /// <param name="editMode"></param>
        /// <param name="item"></param>
        public ConditionalAssign(bool editMode, ListBoxItemSource item)
        {
            InitializeComponent();
            this.editMode = editMode;
            SelectedItem  = item;
            FillConditionalComboboxes();
            EwavRule_ConditionalAssign ca = (EwavRule_ConditionalAssign)SelectedItem.Rule;

            txtDestinationField.IsEnabled = false;
            cbxFieldType.SelectedIndex    = SearchColumnIndex(cbxFieldType.Items, ca.CbxFieldType.ToString());
            cbxFieldType.IsEnabled        = false;

            switch (cbxFieldType.SelectedValue.ToString().ToUpper().Replace("/", ""))
            {
            case "YESNO":
                cmbAssignValue.SelectedIndex = SearchColumnIndex(cmbAssignValue.Items, (ca.AssignValue == "True") ? "Yes" : "No");
                if (ca.ElseValue.Length > 0)
                {
                    cmbElseValue.SelectedIndex = SearchColumnIndex(cmbElseValue.Items, (ca.ElseValue == "True") ? "Yes" : "No");
                }

                if (cmbElseValue.SelectedIndex > 0)
                {
                    checkboxUseElse.IsChecked = true;
                }
                break;

            default:
                txtAssignValue.Text = ca.AssignValue;
                txtElseValue.Text   = ca.ElseValue;
                if (ca.ElseValue.Length > 0)
                {
                    checkboxUseElse.IsChecked = true;
                }
                break;
            }

            if (checkboxUseElse.IsChecked == true)
            {
                txtElseValue.IsEnabled = true;
            }
            else
            {
                txtElseValue.IsEnabled = false;
            }

            txtDestinationField.Text = ca.TxtDestination;

            //FillSelectionComboboxes();

            pnlGuidedMode.Visibility = System.Windows.Visibility.Visible;
            //pnlBtns.Visibility = System.Windows.Visibility.Visible;
            pnlAdvancedMode.Visibility = System.Windows.Visibility.Collapsed;
            pnlContainer.Visibility    = System.Windows.Visibility.Visible;

            //ctrl = new EwavFilterControl();
            FilterCtrl.FilterType = FilterControlType.Conditional;
            FilterCtrl.ConstructStackPanelFromDataFilters(((EwavRule_ConditionalAssign)SelectedItem.Rule).ConditionsList);
        }
Пример #2
0
 public GadgetFilterControl(List <EwavDataFilterCondition> Conditions)
 {
     InitializeComponent();
     FilterCtrl.FilterType = FilterControlType.DataFilter;
     FilterCtrl.ConstructStackPanelFromDataFilters(Conditions);
 }