Пример #1
0
 public BindingListView(ViewInfo viewInfo, IList innerList)
 {
     ViewInfo        = viewInfo;
     InnerList       = innerList;
     _pivoter        = new Pivoter(viewInfo);
     UnfilteredItems = _pivoter.ExpandAndPivot(innerList.Cast <object>().Select(o => new RowItem(null, o))).ToArray();
 }
Пример #2
0
        public ColumnSelector(ColumnDescriptor rootColumn, PropertyPath propertyPath)
        {
            var viewSpec = new ViewSpec().SetColumns(ImmutableList.Singleton(new ColumnSpec(propertyPath)))
                           .SetSublistId(propertyPath);

            ViewInfo = new ViewInfo(rootColumn, viewSpec);
            var displayColumn = ViewInfo.DisplayColumns[0];

            if (displayColumn.ColumnDescriptor != null && null != displayColumn.ColumnDescriptor.CollectionAncestor())
            {
                Pivoter = new Pivoter(ViewInfo);
            }
        }
Пример #3
0
        private IEnumerable <object> GetAllValues(object rootObject)
        {
            if (Pivoter == null)
            {
                return(new[] { GetSingleValue(rootObject) });
            }
            var columnDescriptor = ViewInfo.DisplayColumns[0].ColumnDescriptor;
            var rowItem          = new RowItem(rootObject);

            if (Pivoter == null)
            {
                return(new[] { columnDescriptor.GetPropertyValue(rowItem, null) });
            }

            var pivotedRows = Pivoter.ExpandAndPivot(ViewInfo.DataSchema.QueryLock.CancellationToken, new[] { rowItem });

            return(pivotedRows.RowItems.Select(item => columnDescriptor.GetPropertyValue(item, null)));
        }