public DisplayColumn(ViewInfo viewInfo, ColumnSpec columnSpec, ColumnDescriptor columnDescriptor) { ViewInfo = viewInfo; ColumnDescriptor = columnDescriptor; ColumnSpec = columnSpec; CollectionColumn = columnDescriptor == null ? null : columnDescriptor.CollectionAncestor() ?? viewInfo.ParentColumn; }
public ColumnSpec(ColumnSpec that) { Name = that.Name; Caption = that.Caption; Format = that.Format; Aggregate = that.Aggregate; Hidden = that.Hidden; }
public ColumnSpec(ColumnSpec that) { Name = that.Name; Caption = that.Caption; Format = that.Format; Hidden = that.Hidden; SortIndex = that.SortIndex; SortDirection = that.SortDirection; Total = that.Total; }
public bool Equals(ColumnSpec other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Name, Name) && Equals(other.Caption, Caption) && Equals(other.Format, Format) && Equals(other.Hidden, Hidden) && Equals(other.Aggregate, Aggregate)); }
public static ColumnSpec ReadXml(XmlReader reader) { var columnSpec = new ColumnSpec(); columnSpec.Name = reader.GetAttribute("name"); columnSpec.Caption = reader.GetAttribute("caption"); columnSpec.Format = reader.GetAttribute("format"); columnSpec.Hidden = "true" == reader.GetAttribute("hidden"); bool empty = reader.IsEmptyElement; reader.ReadElementString("column"); if (!empty) { reader.ReadEndElement(); } return(columnSpec); }
// ReSharper restore NonLocalizedString public bool Equals(ColumnSpec other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Name, Name) && Equals(other.Caption, Caption) && Equals(other.Format, Format) && Equals(other.Hidden, Hidden) && Equals(other.SortIndex, SortIndex) && Equals(other.SortDirection, SortDirection) && Equals(other.Total, Total)); }
// 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); }
// ReSharper disable NonLocalizedString public static ColumnSpec ReadXml(XmlReader reader) { TotalOperation total = TotalOperation.GroupBy; string strTotal = reader.GetAttribute("total"); if (strTotal != null) { total = (TotalOperation)Enum.Parse(typeof(TotalOperation), strTotal); } var columnSpec = new ColumnSpec { Name = reader.GetAttribute("name"), Caption = reader.GetAttribute("caption"), Format = reader.GetAttribute("format"), Hidden = "true" == reader.GetAttribute("hidden"), Total = total, }; string sortIndex = reader.GetAttribute("sortindex"); if (sortIndex != null) { columnSpec.SortIndex = Convert.ToInt32(sortIndex); } string sortDirection = reader.GetAttribute("sortdirection"); if (sortDirection != null) { columnSpec.SortDirection = (ListSortDirection)Enum.Parse(typeof(ListSortDirection), sortDirection); } bool empty = reader.IsEmptyElement; reader.ReadElementString("column"); if (!empty) { reader.ReadEndElement(); } return(columnSpec); }
public static ViewSpec ReadXml(XmlReader reader) { var viewSpec = new ViewSpec(); viewSpec.Name = reader.GetAttribute("name"); viewSpec.SublistName = reader.GetAttribute("sublist"); var columns = new List <ColumnSpec>(); var sorts = new List <SortSpec>(); 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("sort")) { sorts.Add(SortSpec.ReadXml(reader)); } else if (reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); break; } else { reader.Read(); } } viewSpec.Sorts = new ReadOnlyCollection <SortSpec>(sorts.ToArray()); viewSpec.Columns = new ReadOnlyCollection <ColumnSpec>(columns.ToArray()); return(viewSpec); }
public ViewSpec() { Columns = new ColumnSpec[0]; Sorts = new SortSpec[0]; }
public ColumnDescriptor SetColumnSpec(ColumnSpec columnSpec) { return(SetCaption(columnSpec.Caption) .SetHidden(columnSpec.Hidden)); }
public ViewSpec() { Columns = new ColumnSpec[0]; Filters = new FilterSpec[0]; }