コード例 #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);
        }