Exemplo n.º 1
0
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (ColumnComboBox != null)
            {
                ColumnComboBox.Dispose();
                ColumnComboBox = null;
            }

            if (FilterTableView != null)
            {
                FilterTableView.Dispose();
                FilterTableView = null;
            }

            if (OperatorComboBox != null)
            {
                OperatorComboBox.Dispose();
                OperatorComboBox = null;
            }

            if (RemoveButton != null)
            {
                RemoveButton.Dispose();
                RemoveButton = null;
            }

            if (ValueTextField != null)
            {
                ValueTextField.Dispose();
                ValueTextField = null;
            }

            if (UpdateButton != null)
            {
                UpdateButton.Dispose();
                UpdateButton = null;
            }
        }
Exemplo n.º 2
0
 private void PopulateOnSelect(int row)
 {
     if (row > -1)
     {
         ValueTextField.StringValue = Filters [row].Value;
         var col = Filters [row].Column.GetDescription();
         ColumnComboBox.Select(NSObject.FromObject(col));
         var op = Filters [row].Operator.GetDescription();
         OperatorComboBox.Select(NSObject.FromObject(op));
     }
 }
        /// <summary>
        /// Populates the combo box.
        /// </summary>
        private void PopulateComboBox()
        {
            ColumnComboBox.RemoveAll();
            ColumnComboBox.UsesDataSource = true;
            ColumnComboBox.Completes      = false;
            ColumnComboBox.DataSource     = new ColumnsDataSource();

            OperatorComboBox.RemoveAll();
            OperatorComboBox.UsesDataSource = true;
            OperatorComboBox.Completes      = false;
            OperatorComboBox.DataSource     = new OperatorsDataSource();
        }
        /// <summary>
        /// Adds the filter criteria when the button is activated.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        void AddButton_Activated(object sender, EventArgs e)
        {
            var op             = Operator.Contains;
            var filterCriteria = new FilterCriteriaDto {
                Column   = ColumnComboBox.SelectedValue.ToString(),
                Operator = (Operator)EnumHelper.GetByDescription(op, OperatorComboBox.SelectedValue.ToString()),
                Value    = ValueTextField.StringValue
            };

            FilterCriteriaDataSource.Entries.Add(filterCriteria);
            FilterTableView.DataSource = FilterCriteriaDataSource;
            FilterTableView.ReloadData();

            ColumnComboBox.SelectItem(0);
            OperatorComboBox.SelectItem(0);
            ValueTextField.StringValue = string.Empty;
        }
Exemplo n.º 5
0
        void ColumnComboBox_SelectionChanged(object sender, EventArgs e)
        {
            var rowId = ((int)ColumnComboBox.SelectedIndex);

            if (rowId > -1)
            {
                FilterColumn column         = new FilterColumn();
                var          selColumnValue = ColumnComboBox.SelectedValue as NSString;
                var          col            = (FilterColumn)column.GetByDescription(selColumnValue.ToString());
                var          operators      = GetDataSource(col);
                var          ops            = operators.Select(x => NSObject.FromObject(x)).ToArray();
                OperatorComboBox.StringValue = (NSString)string.Empty;
                OperatorComboBox.RemoveAll();
                OperatorComboBox.Add(ops);
                SetAddButtonStatus();
                SetUpdateButtonStatus();
            }
        }