private void OnSetFilterClick(object sender, EventArgs e) { FilterProperties setFilterForm = new FilterProperties(); setFilterForm.FilterChangeEvent += new EventHandler <FilterChangeEventArgs>(this.OnFilterChangeEvent); setFilterForm.Show(); }
public virtual bool PassesFilter(FilterProperties filters) { if (filters == null) { return(true); } if (Ratings.Level(ParentalRating) > filters.RatedLessThan) { return(false); } if (Ratings.Level(ParentalRating) < filters.RatedGreaterThan) { return(false); } if (filters.IsFavorite != null && UserData != null && UserData.IsFavorite != filters.IsFavorite) { return(false); } if (!filters.OfTypes.Contains(DisplayMediaType)) { return(false); } return(true); }
public void UpdateFilter(FilterProperties props) { // capture form1 controls info m_FilterProperties = props; // invoke the filter base.UpdateFilter(); }
public TimelineEventsView(CouchbaseStorageLongoMatch storage) : base(storage) { DocumentType = "TimelineEvent"; /* We emit 1 row per player changing the Players property to Player */ FilterProperties.Remove("Players"); FilterProperties.Remove("Teams"); FilterProperties.Add("Player", true); FilterProperties.Add("Team", true); }
/// <summary> /// Constructor /// </summary> public Reports() { CanCreateNewReport = new CanCreateNewReport(); DataSources = new DataSources(); ReportPartTypes = new ReportPartTypes(); ReportCategoriesSubcategories = new ReportCategoriesSubcategories(); FilterProperties = new FilterProperties(); FieldProperties = new FieldProperties(); Actions = new Actions(); }
private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == _source.Columns["Value"].Ordinal) { string error = FilterProperties.CheckFilter(GetFilterProperties(_source.Rows[e.RowIndex])); if (!string.IsNullOrEmpty(error)) { MessageBox.Show("Wrong value: " + error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); _source.Rows[e.RowIndex]["Value"] = null; _source.Rows[e.RowIndex]["Operator"] = null; } } }
private FilterProperties GetFilterProperties() { var filters = new FilterProperties(); if (Parent != null) // Don't ever filter the root { if (DisplayPreferences == null) { LoadDisplayPreferences(); } if (DisplayPreferences != null) { filters.IsUnWatched = Parent != null && Parent.Parent != null ? Parent.Filters.IsUnWatched :Boolean.Parse(DisplayPreferences.CustomPrefs.GetValueOrDefault("IsUnWatched", Boolean.FalseString)); filters.IsFavorite = DisplayPreferences.CustomPrefs.GetValueOrDefault("IsFavorite", null) == Boolean.TrueString; } } return(filters); }
public override void ShowProperties() { var layerProps = new FilterProperties(); layerProps.Name = Name; layerProps.FilterType = Type; var prevT = Type; layerProps.ValuesChanged += layerProps_ValuesChanged; if (layerProps.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Name = layerProps.Name; Type = layerProps.FilterType; } else { Type = prevT; } Invalidate(); }
protected void InitializeRuleset() { When(x => x.RecordsPerPage.HasValue, () => RuleFor(x => x.RecordsPerPage).GreaterThan((uint)0)); When(x => x.StartRow.HasValue, () => RuleFor(x => x.StartRow).GreaterThan((uint)0)); var filters = FilterProperties.ToArray(); RuleFor(x => x).Custom((target, context) => ValidateAndPrefillFilterObject(target, context, filters)); var allowed = SortProperties.SelectMany(sort => new[] { sort, $"-{sort}" }).ToArray(); var allowedAsString = string.Join(", ", allowed); var expr = string.Join("|", allowed); var regExpr = new Regex(expr, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); RuleFor(x => x.OrderBy) .Matches(regExpr) .WithMessage(x => $"{{PropertyName}} must must match one of the following sort expressions {allowedAsString}"); }
public List <FilterSortingProps> GetBookFilterProps() { FilterProperties filterProperties = new FilterProperties(); return(filterProperties.GetBookFilterProps()); }
protected override void ClauseNodeFirstOperandChanged(OperandProperty newProp, int elementIndex) { base.ClauseNodeFirstOperandChanged(newProp, elementIndex); Operation = ((CustomFilterControl)((WinFilterTreeNodeModel)Model).Control).GetDefaultOperationCore( FilterProperties.GetProperty(newProp), Operation); }
private FilterProperties GetFilterProperties() { FilterProperties filterProp; String runTimeHour = "", runTimeMinute = "", actionName = ""; try { filterProp = new FilterProperties(); foreach (Control control in _panelRight.Controls) { if (control.Name.Equals("txtBoxTblName")) { if (!String.IsNullOrEmpty(control.Text)) { filterProp.tableName = control.Text; } else { MessageBox.Show("Please write a table name", "Filter", MessageBoxButtons.OK, MessageBoxIcon.Warning); return null; } } if (control.Name.Equals("cmBoxFilterName")) { if (!String.IsNullOrEmpty(control.Text)) { filterProp.filterName = control.Text; } else { MessageBox.Show("Please write a filter name","Filter", MessageBoxButtons.OK, MessageBoxIcon.Warning); return null; } } if (control.Name.Equals("txtBoxFunctionName")) { if (!String.IsNullOrEmpty(control.Text)) { filterProp.functionName = control.Text; } else { MessageBox.Show("Please write a function name", "Filter", MessageBoxButtons.OK, MessageBoxIcon.Warning); return null; } } if (control.Name.Equals("cmBoxActionType")) { actionName = control.Text; } if (control.Name.Equals("numUpDownHour")) { runTimeHour = control.Text; } if (control.Name.Equals("numUpDownMinute")) { runTimeMinute = control.Text; } if (control.Name.Equals("txtBoxTarget")) { filterProp.target = control.Text; } if (control.Name.Equals("txtBoxDescription")) { filterProp.description = control.Text; } } filterProp.runTime = Convert.ToDateTime(runTimeHour + ":" + runTimeMinute); filterProp.runTime = filterProp.runTime.AddDays(1); filterProp.actionType = GetActionNo(actionName); return filterProp; } catch (Exception) { throw; } }