Exemple #1
0
        public CellQueryOutput <TResult> GetResults <TResult>(SurfaceTarget surface)
        {
            RestrictToShapesOnly(surface);

            var            srcstream        = this._build_src_stream();
            const object[] unitcodes        = null;
            var            values           = surface.GetResults <TResult>(srcstream, unitcodes);
            var            seg_builder      = new VisioAutomation.Utilities.ArraySegmentReader <TResult>(values);
            var            output_for_shape = this._create_output_for_shape(surface.ID16, seg_builder);

            return(output_for_shape);
        }
        public static List <TabStop> GetTabStops(IVisio.Shape shape)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException(nameof(shape));
            }

            int num_stops = _get_tab_stop_count(shape);

            if (num_stops < 1)
            {
                return(new List <TabStop>(0));
            }

            const short row = 0;

            var srcs = new List <VASS.Src>(num_stops * 3);

            for (int stop_index = 0; stop_index < num_stops; stop_index++)
            {
                int i = stop_index * 3;

                var src_tabpos   = new ShapeSheet.Src(tab_section, row, (short)(i + 1));
                var src_tabalign = new ShapeSheet.Src(tab_section, row, (short)(i + 2));
                var src_tabother = new ShapeSheet.Src(tab_section, row, (short)(i + 3));

                srcs.Add(src_tabpos);
                srcs.Add(src_tabalign);
                srcs.Add(src_tabother);
            }

            var streamarray = VASS.Streams.StreamArray.FromSrc(srcs);

            var surface = new SurfaceTarget(shape);

            const object[] unitcodes = null;

            var results = surface.GetResults <double>(streamarray, unitcodes);

            var stops_list = new List <TabStop>(num_stops);

            for (int stop_index = 0; stop_index < num_stops; stop_index++)
            {
                var pos   = results[(stop_index * 3) + 1];
                var align = (TabStopAlignment)((int)results[(stop_index * 3) + 2]);
                var ts    = new TabStop(pos, align);
                stops_list.Add(ts);
            }

            return(stops_list);
        }
Exemple #3
0
        public SectionQueryResults <TResult> GetResults <TResult>(SurfaceTarget surface, ShapeIDPairs shapeidpairs)
        {
            // Store information about the sections we need to query
            var cache = _create_sectionquerycache(shapeidpairs);

            // Perform the query
            var            srcstream = this._build_sidsrc_stream(shapeidpairs, cache);
            const object[] unitcodes = null;
            var            values    = surface.GetResults <TResult>(srcstream, unitcodes);
            var            reader    = new VASS.Internal.ArraySegmentReader <TResult>(values);
            var            results   = this._create_outputs_for_shapes(shapeidpairs, cache, reader);

            return(results);
        }
Exemple #4
0
        public CellQueryOutputList <TResult> GetResults <TResult>(SurfaceTarget surface, IList <int> shapeids)
        {
            var shapes = new List <Microsoft.Office.Interop.Visio.Shape>(shapeids.Count);

            shapes.AddRange(shapeids.Select(shapeid => surface.Shapes.ItemFromID16[(short)shapeid]));

            var            srcstream   = this._build_sidsrc_stream(shapeids);
            const object[] unitcodes   = null;
            var            values      = surface.GetResults <TResult>(srcstream, unitcodes);
            var            seg_builder = new VisioAutomation.Utilities.ArraySegmentReader <TResult>(values);
            var            list        = this._create_outputs_for_shapes(shapeids, seg_builder);

            return(list);
        }
        public CellQueryResults <TResult> GetResults <TResult>(SurfaceTarget surface, IList <int> shapeids)
        {
            var            srcstream = this._build_sidsrc_stream(shapeids);
            const object[] unitcodes = null;
            var            values    = surface.GetResults <TResult>(srcstream, unitcodes);
            var            reader    = new Internal.ArraySegmentReader <TResult>(values);
            var            rows      = this._shapesid_to_rows(shapeids, reader);

            var cellqueryresults = new CellQueryResults <TResult>(rows.Count);

            cellqueryresults.AddRange(rows);

            return(cellqueryresults);
        }
Exemple #6
0
        public SectionQueryShapeResults <TResult> GetResults <TResult>(SurfaceTarget surface)
        {
            _RestrictToShapesOnly(surface);

            var shapeidpairs = ShapeIDPairs.FromShapes(surface.Shape);
            var cache        = this._create_sectionquerycache(shapeidpairs);

            var            srcstream        = this._build_src_stream(cache);
            const object[] unitcodes        = null;
            var            values           = surface.GetResults <TResult>(srcstream, unitcodes);
            var            shape_index      = 0;
            var            sectioncache     = cache[shape_index];
            var            reader           = new VASS.Internal.ArraySegmentReader <TResult>(values);
            var            output_for_shape = this._create_output_for_shape(surface.ID16, sectioncache, reader);

            return(output_for_shape);
        }
        public CellQueryResults <TResult> GetResults <TResult>(SurfaceTarget surface)
        {
            _restrict_to_shapes_only(surface);

            var            srcstream = this._build_src_stream();
            const object[] unitcodes = null;
            var            values    = surface.GetResults <TResult>(srcstream, unitcodes);
            var            reader    = new Internal.ArraySegmentReader <TResult>(values);
            var            row       = this._shapedata_to_row(surface.ID16, reader);


            var cellqueryresults = new CellQueryResults <TResult>(1);

            cellqueryresults.Add(row);

            return(cellqueryresults);
        }
Exemple #8
0
        public SectionsQueryOutput <TResult> GetResults <TResult>(SurfaceTarget surface)
        {
            RestrictToShapesOnly(surface);

            var shapes = new List <Microsoft.Office.Interop.Visio.Shape> {
                surface.Shape
            };

            this.cache_section_info(shapes);
            var            srcstream        = this._build_src_stream();
            const object[] unitcodes        = null;
            var            values           = surface.GetResults <TResult>(srcstream, unitcodes);
            var            shape_index      = 0;
            var            sectioninfo      = this.GetSectionInfoForShape(shape_index, _cache);
            var            seg_builder      = new VisioAutomation.Utilities.ArraySegmentReader <TResult>(values);
            var            output_for_shape = this._create_output_for_shape(surface.ID16, sectioninfo, seg_builder);

            return(output_for_shape);
        }