public void Filter(RowViewModel row) { if (row.Raw.IndexOf(Text, IgnoreCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture) >= 0) { if (Color.HasValue) row.Color = Color.Value; row.Hidden = Hide; } }
public static RowViewModel Parse(ScutSettings settings, string row) { var rvm = new RowViewModel { Raw = row, Data = row.Split(settings.ColumnSeparator) }; foreach (var filter in settings.Filters) { filter.Filter(rvm); } if (rvm.Data.Length != settings.ColumnSettings.Count) { rvm.Color = Color.DarkSalmon; } return rvm; }
private bool EvaluateGrid(RowViewModel model) { var columns = _settings.ColumnSettings; var data = model.Data; if (columns.Count < data.Length) { columns.AddRange(Enumerable.Range(1, (data.Length - columns.Count)).Select(i => new ColumnSetting{Name = "column"+i})); _settings.ColumnSettings = columns; return true; } if (columns.Count > data.Length) { columns = columns.Take(data.Length).ToList(); _settings.ColumnSettings = columns; return true; } return false; }