public static dataPointAggregationDefinition Aggregation(this DataColumn dc, dataPointAggregationDefinition default_data_aggregation_type) { if (!dc.ExtendedProperties.ContainsKey(templateFieldDataTable.data_aggregation_type)) { dc.ExtendedProperties.add(templateFieldDataTable.data_aggregation_type, default_data_aggregation_type); } return((dataPointAggregationDefinition)dc.ExtendedProperties[templateFieldDataTable.data_aggregation_type]); }
public static dataPointAggregationDefinition GetAggregation(this DataColumn dc) { if (!dc.ExtendedProperties.ContainsKey(templateFieldDataTable.data_aggregation_type)) { dataPointAggregationDefinition output = new dataPointAggregationDefinition(); dc.SetAggregation(output); return(output); } return((dataPointAggregationDefinition)dc.ExtendedProperties[templateFieldDataTable.data_aggregation_type]); }
public static DataColumn SetAggregation(this DataColumn dc, dataPointAggregationDefinition data_aggregation_type) { dc.ExtendedProperties.add(templateFieldDataTable.data_aggregation_type, data_aggregation_type); return(dc); }
public void process(IEnumerable <DataTable> tables, dataPointAggregationAspect __aspect = dataPointAggregationAspect.overlapMultiTable) { aspect = __aspect; string __desc = "This table is result of summary operation (" + aspect.ToString() + ") over tables: "; int tc = 0; int rcMin = int.MaxValue; int rcMax = int.MinValue; int rcProc = 0; DataTable shemaProvider = null; foreach (DataTable dt in tables) { if (shemaProvider == null) { shemaProvider = dt; } tc++; if (tc < 5) { __desc = __desc.add(dt.GetTitle(), ", "); } rcMin = Math.Min(dt.Rows.Count, rcMin); rcMax = Math.Max(dt.Rows.Count, rcMax); rcProc += dt.Rows.Count; } additionalProps.AddRange(shemaProvider.GetAdditionalInfo(), false, false, false); categoriesPriority = shemaProvider.GetCategoryPriority(); if (categoriesPriority.Any()) { } if (tc > 4) { __desc = __desc.add("... in total: " + tc + " tables", ", "); } sources = tc; rowsMax = rcMax; rowsCommon = rcMin; rowsProcessed = rcProc; additionalProps.Add(ADDPROPS_ROWSMAX, rcMax, ADDPROPS_ROWSMAX, "Highest row count in the table set"); additionalProps.Add(ADDPROPS_ROWSCOMMON, rcMin, ADDPROPS_ROWSCOMMON, "Lowest row count in the table set"); additionalProps.Add(ADDPROPS_ROWSPROCESSED, rcProc, ADDPROPS_ROWSPROCESSED, "Total count of rows processed"); additionalProps.Add("Category", categoriesPriority.toCsvInLine()); extraDescriptions.Add("[" + sources + "] source tables had at least [" + rowsCommon + "] rows. Maximum rows per source table: [" + rowsMax + "]"); shemaColumns = new DataColumnMetaDictionary(); foreach (DataColumn dc in shemaProvider.Columns) { /* FINDING AGGREGATION SETTINGS */ settingsPropertyEntry spe = dc.GetSPE(); dataPointAggregationDefinition agg = null; if (spe.aggregation == null) { PropertyInfo pi = dc.ExtendedProperties.getProperObject <PropertyInfo>(templateFieldDataTable.col_propertyInfo); //, col_spe.pi); if (pi != null) { spe = new settingsPropertyEntry(pi); } } if (spe.aggregation == null) { spe.aggregation = new dataPointAggregationDefinition(); } agg = spe.aggregation; /* ----------------------------- */ if (agg[aspect] != dataPointAggregationType.none) { List <dataPointAggregationType> aggTypes = agg[aspect].getEnumListFromFlags <dataPointAggregationType>(); foreach (dataPointAggregationType a in aggTypes) { if (a != dataPointAggregationType.hidden) { shemaColumns.Add(DataColumnInReportTypeEnum.dataSummed, dc, a, dc.GetUnit()); } } } } desc = __desc; }