public ViewSpec GetViewSpec() { return(new ViewSpec() .SetName(Name) .SetRowSource(RowSourceName) .SetSublistId(SublistId) .SetColumns(DisplayColumns.Select(dc => dc.ColumnSpec)) .SetFilters(Filters.Select(filterInfo => filterInfo.FilterSpec))); }
public ICollection <ColumnDescriptor> GetCollectionColumns() { var unboundColumnSet = new HashSet <ColumnDescriptor> { ParentColumn }; var allColumnDescriptors = DisplayColumns.Select(displayColumn => displayColumn.ColumnDescriptor) .Concat(Filters.Select(filter => filter.ColumnDescriptor)) .Where(columnDescriptor => null != columnDescriptor); foreach (var columnDescriptor in allColumnDescriptors) { for (var unboundParent = columnDescriptor.CollectionAncestor(); unboundParent != null; unboundParent = unboundParent.Parent.CollectionAncestor()) { unboundColumnSet.Add(unboundParent); } } return(unboundColumnSet); }