예제 #1
0
        public ShapeGeometryRow AddInfiniteLine(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a, ShapeSheet.CellValueLiteral b)
        {
            var row = ShapeGeometryRow.CreateInfiniteLine(x, y, a, b);

            this.Rows.Add(row);
            return(row);
        }
예제 #2
0
        public ShapeGeometryRow AddArcTo(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a)
        {
            var row = ShapeGeometryRow.CreateArcTo(x, y, a);

            this.Rows.Add(row);
            return(row);
        }
예제 #3
0
        public ShapeGeometryRow AddEllipse(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a, ShapeSheet.CellValueLiteral b, ShapeSheet.CellValueLiteral c, ShapeSheet.CellValueLiteral d)
        {
            var row = ShapeGeometryRow.CreateEllipse(x, y, a, b, c, d);

            this.Rows.Add(row);
            return(row);
        }
예제 #4
0
        public ShapeGeometryRow AddLineTo(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y)
        {
            var row = ShapeGeometryRow.CreateLineTo(x, y);

            this.Rows.Add(row);
            return(row);
        }
예제 #5
0
        public ShapeGeometryRow AddNURBSTo(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a, ShapeSheet.CellValueLiteral b, ShapeSheet.CellValueLiteral c, ShapeSheet.CellValueLiteral d, ShapeSheet.CellValueLiteral e)
        {
            var row = ShapeGeometryRow.CreateNURBSTo(x, y, a, b, c, d, e);

            this.Rows.Add(row);
            return(row);
        }
        public static ShapeGeometryRow CreateMoveTo(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y)
        {
            // http://msdn.microsoft.com/en-us/library/aa195679(v=office.11).aspx

            var row = new ShapeGeometryRow(IVisio.VisRowTags.visTagMoveTo);

            row.X = x;
            row.Y = y;
            return(row);
        }
예제 #7
0
        public static void Set(IVisio.Shape shape, string name, ShapeSheet.CellValueLiteral udfcell_value, ShapeSheet.CellValueLiteral udfcell_prompt)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException(nameof(shape));
            }

            UserDefinedCellHelper.CheckValidName(name);

            if (UserDefinedCellHelper.Contains(shape, name))
            {
                string full_prop_name = UserDefinedCellHelper.GetRowName(name);

                if (udfcell_value.HasValue)
                {
                    string value_cell_name = full_prop_name;
                    var    cell            = shape.CellsU[value_cell_name];
                    cell.FormulaU = VisioAutomation.Utilities.Convert.StringToFormulaString(udfcell_value.Value);
                }

                if (udfcell_prompt.HasValue)
                {
                    string prompt_cell_name = full_prop_name + ".Prompt";
                    var    cell             = shape.CellsU[prompt_cell_name];
                    cell.FormulaU = VisioAutomation.Utilities.Convert.StringToFormulaString(udfcell_prompt.Value);
                }
                return;
            }

            short row = shape.AddNamedRow(
                UserDefinedCellHelper._userdefinedcell_section,
                name,
                (short)IVisio.VisRowIndices.visRowUser);

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

            if (udfcell_value.HasValue)
            {
                var src     = new ShapeSheet.Src(UserDefinedCellHelper._userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserValue);
                var formula = VisioAutomation.Utilities.Convert.StringToFormulaString(udfcell_value.Value);
                writer.SetFormula(src, formula);
            }

            if (udfcell_prompt.HasValue)
            {
                var src     = new ShapeSheet.Src(UserDefinedCellHelper._userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserPrompt);
                var formula = VisioAutomation.Utilities.Convert.StringToFormulaString(udfcell_prompt.Value);
                writer.SetFormula(src, formula);
            }

            writer.Commit(shape);
        }
예제 #8
0
        public static GeometryRow CreatePolylineTo(ShapeSheet.CellValueLiteral x,
                                                   ShapeSheet.CellValueLiteral y,
                                                   ShapeSheet.CellValueLiteral a)
        {
            // http://msdn.microsoft.com/en-us/library/aa195682(v=office.11).aspx

            var row = new GeometryRow(IVisio.VisRowTags.visTagPolylineTo);

            row.X = x;
            row.Y = y;
            row.A = a;
            return(row);
        }
        public static ShapeGeometryRow CreateSplineKnot(ShapeSheet.CellValueLiteral x,
                                                        ShapeSheet.CellValueLiteral y,
                                                        ShapeSheet.CellValueLiteral a)
        {
            // http://msdn.microsoft.com/en-us/library/aa195667(v=office.11).aspx

            var row = new ShapeGeometryRow(IVisio.VisRowTags.visTagSplineSpan);

            row.X = x;
            row.Y = y;
            row.A = a;
            return(row);
        }
        public static ShapeGeometryRow CreateInfiniteLine(ShapeSheet.CellValueLiteral x,
                                                          ShapeSheet.CellValueLiteral y,
                                                          ShapeSheet.CellValueLiteral a,
                                                          ShapeSheet.CellValueLiteral b)
        {
            // http://msdn.microsoft.com/en-us/library/aa195682(v=office.11).aspx

            var row = new ShapeGeometryRow(IVisio.VisRowTags.visTagInfiniteLine);

            row.X = x;
            row.Y = y;
            row.A = a;
            row.B = b;
            return(row);
        }
        public static ShapeGeometryRow CreateSplineStart(ShapeSheet.CellValueLiteral x,
                                                         ShapeSheet.CellValueLiteral y,
                                                         ShapeSheet.CellValueLiteral a,
                                                         ShapeSheet.CellValueLiteral b,
                                                         ShapeSheet.CellValueLiteral c,
                                                         ShapeSheet.CellValueLiteral d)
        {
            // http://msdn.microsoft.com/en-us/library/aa195663(v=office.11).aspx

            var row = new ShapeGeometryRow(IVisio.VisRowTags.visTagSplineBeg);

            row.X = x;
            row.Y = y;
            row.A = a;
            row.B = b;
            row.C = c;
            row.D = d;
            return(row);
        }
예제 #12
0
        public static GeometryRow CreateEllipticalArcTo(ShapeSheet.CellValueLiteral x,
                                                        ShapeSheet.CellValueLiteral y,
                                                        ShapeSheet.CellValueLiteral a,
                                                        ShapeSheet.CellValueLiteral b,
                                                        ShapeSheet.CellValueLiteral c,
                                                        ShapeSheet.CellValueLiteral d)
        {
            // http://msdn.microsoft.com/en-us/library/aa195660(v=office.11).aspx

            var row = new GeometryRow(IVisio.VisRowTags.visTagEllipticalArcTo);

            row.X = x;
            row.Y = y;
            row.A = a;
            row.B = b;
            row.C = c;
            row.D = d;
            return(row);
        }
        public static ShapeGeometryRow CreateNurbsTo(ShapeSheet.CellValueLiteral x,
                                                     ShapeSheet.CellValueLiteral y,
                                                     ShapeSheet.CellValueLiteral a,
                                                     ShapeSheet.CellValueLiteral b,
                                                     ShapeSheet.CellValueLiteral c,
                                                     ShapeSheet.CellValueLiteral d,
                                                     ShapeSheet.CellValueLiteral e)
        {
            // http://msdn.microsoft.com/en-us/library/aa195685(v=office.11).aspx

            var row = new ShapeGeometryRow(IVisio.VisRowTags.visTagEllipse);

            row.X = x;
            row.Y = y;
            row.A = a;
            row.B = b;
            row.C = c;
            row.D = d;
            row.E = e;
            return(row);
        }
예제 #14
0
        private string SmartStringToFormulaString(ShapeSheet.CellValueLiteral formula, bool force_no_quoting)
        {
            if (!formula.HasValue)
            {
                return(null);
            }

            if (formula.Value.Length == 0)
            {
                return(VisioAutomation.Utilities.Convert.StringToFormulaString(formula.Value));
            }

            if (formula.Value[0] != '\"')
            {
                if (force_no_quoting)
                {
                    return(formula.Value);
                }
                return(VisioAutomation.Utilities.Convert.StringToFormulaString(formula.Value));
            }

            return(formula.Value);
        }
예제 #15
0
        private string SmartStringToFormulaString(ShapeSheet.CellValueLiteral formula, bool force_no_quoting)
        {
            if (!formula.HasValue)
            {
                return(null);
            }

            if (formula.Value.Length == 0)
            {
                return(formula.Encode());
            }

            if (formula.Value[0] != '\"')
            {
                if (force_no_quoting)
                {
                    return(formula.Value);
                }
                return(formula.Encode());
            }

            return(formula.Value);
        }
예제 #16
0
        public GeometryRow AddSplineKnot(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a)
        {
            var row = GeometryRow.CreateSplineKnot(x, y, a);

            this.Rows.Add(row);
            return(row);
        }
예제 #17
0
        public GeometryRow AddPolylineTo(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a)
        {
            var row = GeometryRow.CreatePolylineTo(x, y, a);

            this.Rows.Add(row);
            return(row);
        }
예제 #18
0
        public GeometryRow AddSplineStart(ShapeSheet.CellValueLiteral x, ShapeSheet.CellValueLiteral y, ShapeSheet.CellValueLiteral a, ShapeSheet.CellValueLiteral b, ShapeSheet.CellValueLiteral c, ShapeSheet.CellValueLiteral d)
        {
            var row = GeometryRow.CreateSplineStart(x, y, a, b, c, d);

            this.Rows.Add(row);
            return(row);
        }
예제 #19
0
 protected SrcFormulaPair newpair(ShapeSheet.Src src, ShapeSheet.CellValueLiteral formula)
 {
     return(new SrcFormulaPair(src, formula));
 }
예제 #20
0
 public SrcFormulaPair(ShapeSheet.Src src, ShapeSheet.CellValueLiteral formula)
 {
     this.Src     = src;
     this.Formula = formula;
 }
예제 #21
0
 public CustomPropertyCells(ShapeSheet.CellValueLiteral value)
 {
     this.Value = value;
     this.Type  = 2;
 }