Exemple #1
0
        private VisioAutomation.ShapeSheet.Streams.StreamArray buildstream_sidsrc(WriteCache <SidSrc> wcs)
        {
            var builder = new VisioAutomation.ShapeSheet.Streams.SidSrcStreamArrayBuilder(wcs.Count);

            builder.AddRange(wcs.EnumCoords());
            return(builder.ToStreamArray());
        }
        public void FixedSrcBuilder_ThrowsException_when_not_full()
        {
            bool caught = false;

            try
            {
                var b1 = new VA.ShapeSheet.Streams.SrcStreamArrayBuilder(1);
                var s1 = b1.ToStreamArray();
            }
            catch (System.ArgumentException e)
            {
                caught = true;
            }

            if (!caught)
            {
                Assert.Fail("Did not catch expected exception");
            }

            var b2     = new VA.ShapeSheet.Streams.SidSrcStreamArrayBuilder(1);
            var src    = new Src((short)0, (short)0, (short)0);
            var sidsrc = new SidSrc((short)0, src);

            b2.Add(sidsrc);
            var s2 = b2.ToStreamArray();
        }
Exemple #3
0
        private VisioAutomation.ShapeSheet.Streams.StreamArray _build_sidsrc_stream(IList <int> shapeids)
        {
            int numshapes = shapeids.Count;
            int numcells  = this._get_total_cell_count(numshapes);

            var stream = new VisioAutomation.ShapeSheet.Streams.SidSrcStreamArrayBuilder(numcells);

            for (int shapeindex = 0; shapeindex < shapeids.Count; shapeindex++)
            {
                // For each shape add the cells to query
                var shapeid = shapeids[shapeindex];

                var cellinfos = this._enum_total_cellinfo(shapeid);
                var sidsrcs   = cellinfos.Select(i => i.SidSrc);
                stream.AddRange(sidsrcs);
            }

            return(stream.ToStreamArray());
        }