コード例 #1
0
        public Node <T> AddNewChild(Geometry.Size size)
        {
            var new_child = new Node <T>(Node <T> ._nodeSeqNum++, null, size);

            this.add_child(new_child);
            return(new_child);
        }
コード例 #2
0
        public Drawing_Surface(Geometry.Size sz)
        {
            mDisplay = Display.Impl as Drawing_Display;

            mImage = new Bitmap(sz.Width, sz.Height);

            System.Diagnostics.Debug.Assert(mImage != null);
        }
コード例 #3
0
        internal static void SetSize(IVisio.Page page, Geometry.Size size)
        {
            var writer = new VASS.Writers.SrcWriter();

            writer.SetValue(VASS.SrcConstants.PageWidth, size.Width);
            writer.SetValue(VASS.SrcConstants.PageHeight, size.Height);

            writer.Commit(page.PageSheet, VASS.CellValueType.Formula);
        }
コード例 #4
0
 public FormPage()
 {
     this.Size                 = new Geometry.Size(8.5, 11);
     this.PageMargin           = new PageMargin(0.5, 0.5, 0.5, 0.5);
     this.DefaultFont          = "Segoe UI";
     this.BodyTextSize         = 8.0;
     this.BodyParaSpacingAfter = 0.0;
     this.TitleTextSize        = 15.0;
 }
コード例 #5
0
        internal static void SetSize(IVisio.Page page, Geometry.Size size)
        {
            var writer = new VisioAutomation.ShapeSheet.Writers.SrcWriter();

            writer.SetFormula(VisioAutomation.ShapeSheet.SrcConstants.PageWidth, size.Width);
            writer.SetFormula(VisioAutomation.ShapeSheet.SrcConstants.PageHeight, size.Height);

            writer.Commit(page.PageSheet);
        }
コード例 #6
0
ファイル: TextBlock.cs プロジェクト: pegopu/VisioAutomation
 public TextBlock(Geometry.Size size, string text)
 {
     this.Text                 = text;
     this.Size                 = size;
     this.TextBlockCells       = new VisioAutomation.Text.TextBlockCells();
     this.ParagraphFormatCells = new VisioAutomation.Text.ParagraphFormatCells();
     this.FormatCells          = new Shapes.ShapeFormatCells();
     this.CharacterFormatCells = new VisioAutomation.Text.CharacterFormatCells();
 }
コード例 #7
0
        internal void init(int id, Node <T> parent, Geometry.Size size, T data)
        {
            this.Id     = id;
            this.Size   = size;
            this.Data   = data;
            this.Parent = parent;

            this._child_list    = new List <Node <T> >();
            this.left_neighbor  = null;
            this.right_neighbor = null;
            this.Position       = new Geometry.Point(0, 0);
            this._is_collapsed  = false;
        }
コード例 #8
0
        internal static Geometry.Size GetSize(IVisio.Page page)
        {
            var query      = new CellQuery();
            var col_height = query.Columns.Add(ShapeSheet.SrcConstants.PageHeight, nameof(ShapeSheet.SrcConstants.PageHeight));
            var col_width  = query.Columns.Add(ShapeSheet.SrcConstants.PageWidth, nameof(ShapeSheet.SrcConstants.PageWidth));

            var    results = query.GetResults <double>(page.PageSheet);
            double height  = results.Cells[col_height];
            double width   = results.Cells[col_width];
            var    s       = new Geometry.Size(width, height);

            return(s);
        }
コード例 #9
0
        public static Geometry.Size GetSize(IVisio.Page page)
        {
            var query      = new VASS.Query.CellQuery();
            var col_height = query.Columns.Add(VASS.SrcConstants.PageHeight, nameof(VASS.SrcConstants.PageHeight));
            var col_width  = query.Columns.Add(VASS.SrcConstants.PageWidth, nameof(VASS.SrcConstants.PageWidth));

            var    cellqueryresult = query.GetResults <double>(page.PageSheet);
            var    row             = cellqueryresult[0];
            double height          = row[col_height];
            double width           = row[col_width];
            var    s = new Geometry.Size(width, height);

            return(s);
        }
コード例 #10
0
ファイル: GridLayout.cs プロジェクト: pegopu/VisioAutomation
        public GridLayout(int cols, int rows, Geometry.Size cellsize, IVisio.Master master)
        {
            this.ColumnDirection = ColumnDirection.LeftToRight;
            this.RowDirection    = RowDirection.BottomToTop;
            this.CellSpacing     = new Geometry.Size(0.5, 0.25);
            this.ColumnCount     = cols;
            this.RowCount        = rows;

            // initialize the sizes for the rows and columns
            this.Rows = new List <Row>(this.RowCount);
            foreach (int row in Enumerable.Range(0, this.RowCount))
            {
                var r = new Row();
                r.Height = cellsize.Height;
                this.Rows.Add(r);
            }

            this.Columns = new List <Column>(this.ColumnCount);
            foreach (int col in Enumerable.Range(0, this.ColumnCount))
            {
                var c = new Column();
                c.Width = cellsize.Width;
                this.Columns.Add(c);
            }

            // Create the nodes
            this._nodes = new Node[this.RowCount, this.ColumnCount];
            foreach (int row in Enumerable.Range(0, this.RowCount))
            {
                foreach (int col in Enumerable.Range(0, this.ColumnCount))
                {
                    var node = new Node();
                    node.Column           = col;
                    node.Row              = row;
                    node.Master           = master;
                    node.Draw             = true;
                    this._nodes[row, col] = node;
                }
            }
        }
コード例 #11
0
        public static void ResizeToFitContents(IVisio.Page page, Geometry.Size padding)
        {
            // first perform the native resizetofit
            page.ResizeToFitContents();

            if ((padding.Width > 0.0) || (padding.Height > 0.0))
            {
                // if there is any additional padding requested
                // we need to further handle the page

                // first determine the desired page size including the padding
                // and set the new size

                var old_size = VisioAutomation.Pages.PageHelper.GetSize(page);
                var new_size = old_size + padding.Multiply(2, 2);
                VisioAutomation.Pages.PageHelper.SetSize(page, new_size);

                // The page has the correct size, but
                // the contents will be offset from the correct location
                page.CenterDrawing();
            }
        }
コード例 #12
0
 public override SurfaceImpl CreateSurface(Geometry.Size surfaceSize)
 {
     return(new Drawing_Surface(surfaceSize));
 }
コード例 #13
0
 public Node(Geometry.Size size, T data)
 {
     this.init(Node <T> ._nodeSeqNum++, null, size, data);
 }
コード例 #14
0
 internal Node(int id, Node <T> parent, Geometry.Size size)
 {
     this.init(id, parent, size, default(T));
 }
コード例 #15
0
ファイル: Box.cs プロジェクト: pegopu/VisioAutomation
 protected Box(Geometry.Size s)
 {
     this.Size = s;
 }
コード例 #16
0
 private void AdjustInsertionPoint(Geometry.Size size)
 {
     this.InsertionPoint       = this.InsertionPoint.Add(size.Width, 0);
     this._current_line_height = System.Math.Max(this._current_line_height, size.Height);
 }
コード例 #17
0
 public static void ResizeToFitContents(this IVisio.Page page, Geometry.Size padding)
 {
     Pages.PageHelper.ResizeToFitContents(page, padding);
 }
コード例 #18
0
 protected LayoutBase()
 {
     this.AvenueSize = new Geometry.Size(0.375, 0.375);
 }