예제 #1
0
        public short Render(IVisio.Shape shape)
        {
            short sec_index = GeometryHelper.AddSection(shape);
            short row_count = shape.RowCount[sec_index];

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

            var src_nofill      = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoFill.Cell);
            var src_noline      = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoLine.Cell);
            var src_noshow      = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoShow.Cell);
            var src_nosnap      = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoSnap.Cell);
            var src_noquickdrag = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoQuickDrag.Cell);

            writer.SetFormula(src_nofill, this.NoFill);
            writer.SetFormula(src_noline, this.NoLine);
            writer.SetFormula(src_noshow, this.NoShow);
            writer.SetFormula(src_nosnap, this.NoSnap);
            writer.SetFormula(src_noquickdrag, this.NoQuickDrag);

            foreach (var row in this.Rows)
            {
                row.AddTo(shape, writer, row_count, sec_index);
                row_count++;
            }

            writer.Commit(shape);

            return(0);
        }
예제 #2
0
        private IEnumerable <Internal.QueryCellInfo> _enum_total_cellinfo(int shapeid, int shapeindex)
        {
            // enum Cells
            foreach (var col in this.Cells)
            {
                var sidsrc = new SidSrc((short)shapeid, col.Src);

                var cellinfo = new Internal.QueryCellInfo(sidsrc, col);
                yield return(cellinfo);
            }

            // enum SubQueries
            if (this._cache.CountShapes > 0)
            {
                var section_infos = _cache.GetSectionInfosForShapeAtIndex(shapeindex);
                foreach (var section_info in section_infos)
                {
                    foreach (int rowindex in section_info.RowIndexes)
                    {
                        foreach (var col in section_info.SubQuery.Columns)
                        {
                            var src = new VisioAutomation.ShapeSheet.Src(
                                (short)section_info.SubQuery.SectionIndex,
                                (short)rowindex,
                                col.CellIndex);
                            var sidsrc   = new VisioAutomation.ShapeSheet.SidSrc((short)shapeid, src);
                            var cellinfo = new Internal.QueryCellInfo(sidsrc, col);
                            yield return(cellinfo);
                        }
                    }
                }
            }
        }
예제 #3
0
 public FormatPaintCell(VisioAutomation.ShapeSheet.Src src, string name, FormatPaintCategory paint_category)
 {
     this.PaintCategory = paint_category;
     this.Name          = name;
     this.Src           = src;
     this.Formula       = null;
     this.Result        = null;
 }
예제 #4
0
        public void VerifySrcSize()
        {
            // Srcs must be 6 bytes
            var c1          = new VisioAutomation.ShapeSheet.Src();
            int actual_size = System.Runtime.InteropServices.Marshal.SizeOf(c1);

            Assert.AreEqual(6, actual_size);

            this.VerifyFormulaLiteralSize();
        }
        private void Update(short section_index, short row_index, ShapeSheet.Writers.SrcWriter writer)
        {
            var x_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexX.Cell);
            var y_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexY.Cell);
            var a_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexA.Cell);
            var b_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexB.Cell);
            var c_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexC.Cell);
            var d_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexD.Cell);
            var e_src = new VA.ShapeSheet.Src(section_index, row_index, ShapeSheet.SrcConstants.GeometryVertexE.Cell);

            writer.SetValue(x_src, this.X);
            writer.SetValue(y_src, this.Y);
            writer.SetValue(a_src, this.A);
            writer.SetValue(b_src, this.B);
            writer.SetValue(c_src, this.C);
            writer.SetValue(d_src, this.D);
            writer.SetValue(e_src, this.E);
        }
예제 #6
0
        public void SetFormula(short id, VisioAutomation.ShapeSheet.Src src, string formula)
        {
            var sidsrc = new VisioAutomation.ShapeSheet.SidSrc(id, src);

            this.writer.SetFormula(sidsrc, formula);
        }
예제 #7
0
        public SubQueryColumn AddCell(VisioAutomation.ShapeSheet.Src src, string name)
        {
            var col = this.Columns.Add(src.Cell, name);

            return(col);
        }
예제 #8
0
 public CellTuple(string name, VisioAutomation.ShapeSheet.Src src, string formula)
 {
     this.Name    = name;
     this.Src     = src;
     this.Formula = formula;
 }
예제 #9
0
        public void AddCell(short id, VisioAutomation.ShapeSheet.Src src)
        {
            var sidsrc = new VisioAutomation.ShapeSheet.SidSrc(id, src);

            this.SidSrcStreamBuilder.Add(sidsrc);
        }