public GridRendererContext(
            ImutableGridRendererContext imutableGridRendererContext,
            IRendererTreeBuilder rendererTreeBuilder,
            ITableDataSet tableDataSet,
            ISpecialColumnFragmentsCollection specialColumnFragmentsCollection,
            FlexGridContext flexGridContext)
        {
            if (imutableGridRendererContext is null)
            {
                throw new ArgumentNullException(nameof(imutableGridRendererContext));
            }

            RendererTreeBuilder = rendererTreeBuilder ?? throw new ArgumentNullException(nameof(RendererTreeBuilder));
            TableDataSet        = tableDataSet ?? throw new ArgumentNullException(nameof(tableDataSet));
            FlexGridContext     = flexGridContext ?? throw new ArgumentNullException(nameof(flexGridContext));

            GridConfiguration            = imutableGridRendererContext.GridConfiguration;
            GridItemProperties           = imutableGridRendererContext.GridItemProperties;
            GridItemCollectionProperties = imutableGridRendererContext.GridEntityConfiguration.ClrTypeCollectionProperties;
            CssClasses            = imutableGridRendererContext.CssClasses;
            PropertyValueAccessor = imutableGridRendererContext.GetPropertyValueAccessor;

            gridEntityConfiguration = imutableGridRendererContext.GridEntityConfiguration;
            valueFormatters         = imutableGridRendererContext.ValueFormatters;
            columnRendererFragments = specialColumnFragmentsCollection
                                      .Merge(gridEntityConfiguration, imutableGridRendererContext.ColumnRendererFragments);
            columnEditRendererBuilders = specialColumnFragmentsCollection
                                         .Merge(gridEntityConfiguration, imutableGridRendererContext.ColumnEditRendererBuilders);

            firstColumnName = GridItemProperties.First().Name;
            lastColumnName  = GridItemProperties.Last().Name;
            NumberOfColumns = GridItemProperties.Count +
                              (imutableGridRendererContext.InlineEditItemIsAllowed() || imutableGridRendererContext.CreateItemIsAllowed() ? 1 : 0) +
                              (GridConfiguration.IsMasterTable ? 1 : 0);
        }
Exemple #2
0
 public BlazorComponentColumnCollection(ISpecialColumnFragmentsCollection specialColumnFragmentsCollection)
 {
     this.specialColumnFragmentsCollection = specialColumnFragmentsCollection ?? throw new ArgumentNullException(nameof(specialColumnFragmentsCollection));
 }