Пример #1
0
        private VisioAutomation.ShapeSheet.Streams.StreamArray buildstream_sidsrc(WriteCache <SidSrc> wcs)
        {
            var builder = new VisioAutomation.ShapeSheet.Streams.FixedSidSrcStreamBuilder(wcs.Count);

            builder.AddRange(wcs.EnumCoords());
            return(builder.ToStream());
        }
Пример #2
0
        public void FixedSrcBuilder_ThrowsException_when_not_full()
        {
            bool caught = false;

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

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

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

            b2.Add(sidsrc);
            var s2 = b2.ToStream();
        }
Пример #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.FixedSidSrcStreamBuilder(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, shapeindex);
                var sidsrcs   = cellinfos.Select(i => i.SidSrc);
                stream.AddRange(sidsrcs);
            }

            return(stream.ToStream());
        }