public FilterInfo(FilterSpec filterSpec, ColumnDescriptor columnDescriptor, ColumnDescriptor collectionColumn) { FilterSpec = filterSpec; ColumnDescriptor = columnDescriptor; CollectionColumn = collectionColumn; try { Predicate = MakePredicate(); } catch (Exception e) { Error = e.Message; } }
// ReSharper disable NonLocalizedString public static FilterSpec ReadXml(XmlReader reader) { var filterSpec = new FilterSpec { Column = reader.GetAttribute("column"), Predicate = FilterPredicate.ReadXml(reader), }; bool empty = reader.IsEmptyElement; reader.ReadElementString("filter"); if (!empty) { reader.ReadEndElement(); } return(filterSpec); }
// ReSharper disable NonLocalizedString public static FilterSpec ReadXml(XmlReader reader) { var filterSpec = new FilterSpec { Column = reader.GetAttribute("column"), OpName = reader.GetAttribute("opname"), Operand = reader.GetAttribute("operand") }; bool empty = reader.IsEmptyElement; reader.ReadElementString("filter"); if (!empty) { reader.ReadEndElement(); } return(filterSpec); }
// ReSharper disable LocalizableElement public static ViewSpec ReadXml(XmlReader reader) { var viewSpec = new ViewSpec { Name = reader.GetAttribute("name"), RowSource = reader.GetAttribute("rowsource"), SublistName = reader.GetAttribute("sublist"), UiMode = reader.GetAttribute("uimode") ?? string.Empty }; var columns = new List <ColumnSpec>(); var filters = new List <FilterSpec>(); if (reader.IsEmptyElement) { reader.ReadElementString("view"); return(viewSpec); } reader.Read(); while (true) { if (reader.IsStartElement("column")) { columns.Add(ColumnSpec.ReadXml(reader)); } else if (reader.IsStartElement("filter")) { filters.Add(FilterSpec.ReadXml(reader)); } else if (reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); break; } else { reader.Skip(); } } viewSpec.Columns = ImmutableList.ValueOf(columns); viewSpec.Filters = ImmutableList.ValueOf(filters); return(viewSpec); }
// ReSharper disable NonLocalizedString public static ViewSpec ReadXml(XmlReader reader) { var viewSpec = new ViewSpec { Name = reader.GetAttribute("name"), RowSource = reader.GetAttribute("rowsource"), SublistName = reader.GetAttribute("sublist") }; var columns = new List <ColumnSpec>(); var filters = new List <FilterSpec>(); if (reader.IsEmptyElement) { reader.ReadElementString("view"); return(viewSpec); } reader.Read(); while (true) { if (reader.IsStartElement("column")) { columns.Add(ColumnSpec.ReadXml(reader)); } else if (reader.IsStartElement("filter")) { filters.Add(FilterSpec.ReadXml(reader)); } else if (reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); break; } else { reader.Read(); } } viewSpec.Columns = Array.AsReadOnly(columns.ToArray()); viewSpec.Filters = Array.AsReadOnly(filters.ToArray()); return(viewSpec); }
private FilterSpec(FilterSpec that) { Column = that.Column; Predicate = that.Predicate; }
public ViewSpec() { Columns = new ColumnSpec[0]; Filters = new FilterSpec[0]; }
public FilterSpec(FilterSpec that) { Column = that.Column; OpName = that.OpName; Operand = that.Operand; }