private List <SectionInfo> GetSectionInfoForShape(int shape_index, SectionInfoCache cache) { if (cache.CountShapes > 0) { return(cache.GetSectionInfosForShapeAtIndex(shape_index)); } return(null); }
private void cache_section_info(IList <IVisio.Shape> shapes) { // there aren't any subqueries so return an empty cache if (this.SubQueries.Count < 1) { this._cache = new SectionInfoCache(0); } this._cache = new SectionInfoCache(); // For each shape, for each subquery (section) find the number of rows foreach (var shape in shapes) { var l_sectioninfo = new List <SectionInfo>(this.SubQueries.Count); l_sectioninfo.AddRange(this.SubQueries.Select(subquery => subquery.GetSectionInfoForShape(shape))); _cache.AddSectionInfosForShape(l_sectioninfo); } if (shapes.Count != _cache.CountShapes) { string msg = string.Format("mismatch in number of shapes and information collected for shapes"); throw new VisioAutomation.Exceptions.InternalAssertionException(msg); } }
private QueryOutputCollection <T> _create_outputs_for_shapes <T>(IList <int> shapeids, SectionInfoCache cache, VisioAutomation.Utilities.ArraySegmentReader <T> segReader) { var output_for_all_shapes = new QueryOutputCollection <T>(); for (int shape_index = 0; shape_index < shapeids.Count; shape_index++) { var shapeid = shapeids[shape_index]; var subqueryinfo = this.GetSectionInfoForShape(shape_index, cache); var output_for_shape = this._create_output_for_shape((short)shapeid, subqueryinfo, segReader); output_for_all_shapes.Add(output_for_shape); } return(output_for_all_shapes); }