예제 #1
0
파일: ViewInfo.cs 프로젝트: zrolfs/pwiz
 public ViewSpec GetViewSpec()
 {
     return(new ViewSpec()
            .SetName(Name)
            .SetRowSource(RowSourceName)
            .SetSublistId(SublistId)
            .SetColumns(DisplayColumns.Select(dc => dc.ColumnSpec))
            .SetFilters(Filters.Select(filterInfo => filterInfo.FilterSpec)));
 }
예제 #2
0
        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);
        }