Esempio n. 1
0
        public static int Add(
            IVisio.Shape shape,
            ConnectionPointCells connection_point_cells)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException(nameof(shape));
            }

            if (connection_point_cells.X.Value == null)
            {
                string msg = "Must provide an X Formula";
                throw new System.ArgumentException(msg, nameof(connection_point_cells));
            }

            if (connection_point_cells.Y.Value == null)
            {
                string msg = "Must provide an Y Formula";
                throw new System.ArgumentException(msg, nameof(connection_point_cells));
            }

            var n = shape.AddRow((short)IVisio.VisSectionIndices.visSectionConnectionPts,
                                 (short)IVisio.VisRowIndices.visRowLast,
                                 (short)IVisio.VisRowTags.visTagCnnctPt);

            var writer = new VisioAutomation.ShapeSheet.Writers.SrcWriter();

            writer.SetValues(connection_point_cells, n);

            writer.Commit(shape, VASS.CellValueType.Formula);

            return(n);
        }
Esempio n. 2
0
        public static int Set(
            IVisio.Shape shape,
            short row,
            ConnectionPointCells cpcells)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException(nameof(shape));
            }

            var writer = new VisioAutomation.ShapeSheet.Writers.SrcWriter();

            writer.SetValues(cpcells, row);

            writer.Commit(shape, VASS.CellValueType.Formula);

            return(row);
        }