private void GroupWorksheetRows(int currentRowNum) { while (this.hierarchyRowGroups.Count > 0) { PropertyGridSpreadExport.RowGroup rowGroup = this.hierarchyRowGroups.Pop(); rowGroup.EndRow = currentRowNum - 1; this.readyToExportRowGroups.Push(rowGroup); } while (this.readyToExportRowGroups.Count > 0) { PropertyGridSpreadExport.RowGroup rowGroup = this.readyToExportRowGroups.Pop(); this.spreadExportRenderer.GroupRows(rowGroup.StartRow, rowGroup.EndRow, rowGroup.Level); } }
private void ProcessCurrentRowGrouping(int currentRowHierarchyLevel, int currentRowNum) { if (currentRowHierarchyLevel > this.lastRowHierarchyLevel) { this.hierarchyRowGroups.Push(new PropertyGridSpreadExport.RowGroup(currentRowNum, currentRowHierarchyLevel)); } else if (currentRowHierarchyLevel < this.lastRowHierarchyLevel) { for (int index = this.hierarchyRowGroups.Count > 0 ? this.hierarchyRowGroups.Peek().Level : 0; currentRowHierarchyLevel < index && this.hierarchyRowGroups.Count > 0; index = this.hierarchyRowGroups.Count > 0 ? this.hierarchyRowGroups.Peek().Level : 0) { PropertyGridSpreadExport.RowGroup rowGroup = this.hierarchyRowGroups.Pop(); rowGroup.EndRow = currentRowNum - 1; this.readyToExportRowGroups.Push(rowGroup); } } this.lastRowHierarchyLevel = currentRowHierarchyLevel; }