public ColumnPropertyDescriptor(DisplayColumn displayColumn, string name, PropertyPath propertyPath, PivotKey pivotKey)
     : base(name, displayColumn.GetAttributes(pivotKey).ToArray())
 {
     DisplayColumn = displayColumn;
     PropertyPath  = propertyPath;
     PivotKey      = pivotKey;
 }
 public ColumnPropertyDescriptor(DisplayColumn displayColumn, string name, PropertyPath propertyPath, PivotKey pivotKey)
     : base(name, displayColumn.GetColumnCaption(pivotKey), displayColumn.DataSchema.DataSchemaLocalizer, displayColumn.GetAttributes(pivotKey).ToArray())
 {
     DisplayColumn = displayColumn;
     PropertyPath  = propertyPath;
     PivotKey      = pivotKey;
 }
 public ColumnPropertyDescriptor(DisplayColumn displayColumn, string name, PropertyPath propertyPath, PivotKey pivotKey)
     : base(name, displayColumn.GetAttributes(pivotKey).ToArray())
 {
     DisplayColumn = displayColumn;
     PropertyPath = propertyPath;
     PivotKey = pivotKey;
 }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (PropertyPath != null ? PropertyPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PivotKey != null ? PivotKey.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DisplayColumn != null ? DisplayColumn.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#5
0
        public ViewInfo(ColumnDescriptor parentColumn, ViewSpec viewSpec)
        {
            ParentColumn  = parentColumn;
            DataSchema    = parentColumn.DataSchema;
            Name          = viewSpec.Name;
            RowSourceName = viewSpec.RowSource;

            _columnDescriptors.Add(parentColumn.PropertyPath, parentColumn);
            var displayColumns = new List <DisplayColumn>();

            foreach (var column in viewSpec.Columns)
            {
                var columnDescriptor = GetColumnDescriptor(column.PropertyPath);
                displayColumns.Add(new DisplayColumn(this, column, columnDescriptor));
            }
            DisplayColumns = Array.AsReadOnly(displayColumns.ToArray());
            SublistId      = viewSpec.SublistId;
            var filters = new List <FilterInfo>();

            foreach (var filterSpec in viewSpec.Filters)
            {
                var columnDescriptor = GetColumnDescriptor(filterSpec.ColumnId);
                ColumnDescriptor collectionColumn = null;
                if (columnDescriptor != null)
                {
                    collectionColumn = columnDescriptor.CollectionAncestor() ?? ParentColumn;
                }
                filters.Add(new FilterInfo(filterSpec, columnDescriptor, collectionColumn));
            }

            Filters = Array.AsReadOnly(filters.ToArray());
            var sorts = new List <KeyValuePair <int, DisplayColumn> >();

            for (int i = 0; i < DisplayColumns.Count; i++)
            {
                if (DisplayColumns[i].ColumnSpec.SortDirection != null)
                {
                    sorts.Add(new KeyValuePair <int, DisplayColumn>(i, DisplayColumns[i]));
                }
            }
            if (sorts.Count > 0)
            {
                sorts.Sort(CompareSortEntries);
                SortColumns = Array.AsReadOnly(sorts.Select(kvp => kvp.Value).ToArray());
            }
            else
            {
                SortColumns = new DisplayColumn[0];
            }
        }
示例#6
0
        public ViewInfo(ColumnDescriptor parentColumn, ViewSpec viewSpec)
        {
            ParentColumn = parentColumn;
            DataSchema = parentColumn.DataSchema;
            Name = viewSpec.Name;
            RowSourceName = viewSpec.RowSource;

            _columnDescriptors.Add(parentColumn.PropertyPath, parentColumn);
            var displayColumns = new List<DisplayColumn>();
            foreach (var column in viewSpec.Columns)
            {
                var columnDescriptor = GetColumnDescriptor(column.PropertyPath);
                displayColumns.Add(new DisplayColumn(this, column, columnDescriptor));
            }
            DisplayColumns = Array.AsReadOnly(displayColumns.ToArray());
            SublistId = viewSpec.SublistId;
            var filters = new List<FilterInfo>();
            foreach (var filterSpec in viewSpec.Filters)
            {
                var columnDescriptor = GetColumnDescriptor(filterSpec.ColumnId);
                ColumnDescriptor collectionColumn = null;
                if (columnDescriptor != null)
                {
                    collectionColumn = columnDescriptor.CollectionAncestor() ?? ParentColumn;
                }
                filters.Add(new FilterInfo(filterSpec, columnDescriptor, collectionColumn));
            }
            
            Filters = Array.AsReadOnly(filters.ToArray());
            var sorts = new List<KeyValuePair<int, DisplayColumn>>();
            for (int i = 0; i < DisplayColumns.Count; i++)
            {
                if (DisplayColumns[i].ColumnSpec.SortDirection != null)
                {
                    sorts.Add(new KeyValuePair<int, DisplayColumn>(i, DisplayColumns[i]));
                }
            }
            if (sorts.Count > 0)
            {
                sorts.Sort(CompareSortEntries);
                SortColumns = Array.AsReadOnly(sorts.Select(kvp => kvp.Value).ToArray());
            }
            else
            {
                SortColumns = new DisplayColumn[0];
            }
        }
 public ColumnPropertyDescriptor(DisplayColumn displayColumn, string name) : this(displayColumn, name, displayColumn.PropertyPath, null)
 {
 }
 public ColumnPropertyDescriptor(DisplayColumn displayColumn, string name)
     : this(displayColumn, name, displayColumn.PropertyPath, null)
 {
 }