private SectionQueryShapeResults <T> _create_output_for_shape <T>(short shapeid, ShapeCache shapecacheitems, VASS.Internal.ArraySegmentReader <T> segreader) { int original_seg_count = segreader.Count; if (shapecacheitems == null) { throw new VisioAutomation.Exceptions.InternalAssertionException(); } var results_rows = new List <SectionShapeRows <T> >(shapecacheitems.Count); foreach (var shapecacheitem in shapecacheitems) { var secindex = shapecacheitem.SectionQueryColumns.SectionIndex; var sectionshaperows = new SectionShapeRows <T>(shapecacheitem.RowCount, shapeid, secindex); results_rows.Add(sectionshaperows); int num_cols = shapecacheitem.SectionQueryColumns.Count; foreach (int row_index in Enumerable.Range(0, shapecacheitem.RowCount)) { var cells = segreader.GetNextSegment(num_cols); var sec_res_row = new Row <T>(shapeid, secindex, cells); sectionshaperows.Add(sec_res_row); } } var results = new SectionQueryShapeResults <T>(shapeid, results_rows); // the difference in the segment count must match the total number of output cells int final_seg_count = segreader.Count; int segment_count_delta = final_seg_count - original_seg_count; int total_cell_count = shapecacheitems.CountCells(); if (segment_count_delta != total_cell_count) { throw new Exceptions.InternalAssertionException("Unexpected cursor"); } return(results); }
public void Add(SectionQueryShapeResults <T> item) { this._list.Add(item); }