private LogFilter GetFilterObjectFromUI() { LogFilter FilterObj = null; object BoxVal = 0; FilterOperator Op = (FilterOperator)cbFilterOp.SelectedIndex; FilterSection Sect = (FilterSection)cbFilterSection.SelectedIndex; DebugType DebType = (DebugType)(cbSectionValues.SelectedIndex + 1); string StrValue = txtValue.Text; switch (Sect) { case FilterSection.LogTypeSection: BoxVal = DebType; break; case FilterSection.TagSection: case FilterSection.MessageSection: BoxVal = txtValue.Text; break; case FilterSection.PidSection: { try { BoxVal = int.Parse(StrValue); } catch { } break; } } FilterObj = new LogFilter(Op, BoxVal, Sect); FilterObj.UseRegexp = chkUseRegexp.Checked; return(FilterObj); }
public LogFilter(FilterOperator Op, object value, FilterSection section) { Oper = Op; Value = value; Sect = section; }
public static IFilter ToFilter(this FilterSection filterSection) { var filterRepository = filterSection == null ? null : CreateFilterRepository(filterSection.Included, filterSection.Excluded); return(filterRepository == null ? null : new ItemFilter(filterRepository)); }
public static IFilterRepository ToFilterRepository(this FilterSection filterSection) { return(filterSection == null ? null : CreateFilterRepository(filterSection.Included, filterSection.Excluded)); }