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); } }