예제 #1
0
        private SectionQueryCache _create_sectionquerycache(ShapeIDPairs shapeidpairs)
        {
            // Prepare a cache object
            if (this.Count < 1)
            {
                return(new SectionQueryCache(0));
            }

            var _cache = new SectionQueryCache();

            // For each shape, for each section find the number of rows
            foreach (var shapeidpair in shapeidpairs)
            {
                // For that shape, fill in the section cache for each section that
                // needs to be queried
                var shapecache = new ShapeCache(this.Count);
                foreach (var sec_cols in this)
                {
                    var shapecacheitem = SectionQuery._create_shapesectioncacheitem(shapeidpair, sec_cols.SectionIndex, sec_cols);
                    shapecache.Add(shapecacheitem);
                }

                // For this shape, add the accumulated info into the cache
                _cache.Add(shapecache);
            }

            // Ensure that we have created a cache for eash shapes
            if (shapeidpairs.Count != _cache.Count)
            {
                string msg = string.Format("mismatch in number of shapes and information collected for shapes");
                throw new Exceptions.InternalAssertionException(msg);
            }

            return(_cache);
        }
예제 #2
0
        private static short GetNumRowsForSection(IVisio.Shape shape, SectionQuery sec)
        {
            // For visSectionObject we know the result is always going to be 1
            // so avoid making the call tp RowCount[]
            if (sec.SectionIndex == IVisio.VisSectionIndices.visSectionObject)
            {
                return(1);
            }

            // For all other cases use RowCount[]
            return(shape.RowCount[(short)sec.SectionIndex]);
        }
예제 #3
0
 internal SectionInfo(SectionQuery sectionquery, int numrows)
 {
     this.Query    = sectionquery;
     this.RowCount = numrows;
 }
예제 #4
0
 internal SectionQueryInfo(SectionQuery sq, short shapeid, int numrows)
 {
     this.SectionQuery = sq;
     this.ShapeID      = shapeid;
     this.RowCount     = numrows;
 }