public DateFilter(ExCell exCell) : base() { { From = DateTime.Now.AddDays(-1); To = DateTime.Now; } }
public FilterProto() { var FilterRng = Current.CurRegion.ActiveCell; int col = FilterRng.Column - Current.CurRegion.TblRange.FirstCol; Setter = new TableFilterSetter(this, true); Name = Current.CurRegion.ActiveRow.ExCells[col].ColName; var tmpCell = new ExCell(FilterRng, true); ValueList = tmpCell.ValList; _canFilter = true; _enabled = true; }
public static void AddFilter(Range activeCell) { if (activeCell == null) { return; } var cell = new ExCell(activeCell, true); var flt = CreateFilter(cell); if (flt != null && !Filters.Contains(flt)) { Filters.Add(flt); } }
public NumericFilter(ExCell exCell) : base() { var values = exCell.ValList.Where(v => v.Type == CellValue.CellValType.Numeric). Select(v => v.ValDouble).ToArray(); if (values.Any()) { _from = values.Min(); _to = values.Max(); } else { From = _from = _to; } }
public TimeFilter(ExCell exCell) : base() { ValList = exCell.ValList.Where(v => v.Type == CellValue.CellValType.Time). Select(v => v.ValTime).OrderBy(v => v).ToArray(); if (ValList.Any()) { _from = ValList.Min(); _to = ValList.Max(); } else { _from = new TimeSpan(0); _to = new TimeSpan(23, 59, 59); } }
private static FilterProto CreateFilter(ExCell activeExCell) { switch (activeExCell.Value.Type) { case CellValue.CellValType.String: return(new StrFilter(activeExCell)); case CellValue.CellValType.Numeric: return(new NumericFilter(activeExCell)); case CellValue.CellValType.Date: return(new DateFilter(activeExCell)); case CellValue.CellValType.Time: return(new TimeFilter(activeExCell)); default: return(new StrFilter(activeExCell)); } }
public StrFilter(ExCell exCell) : base() { _patt = ""; }