private static void TestResize(IVisio.Document doc, VA.Drawing.Size bottomleft_margin, VA.Drawing.Size upperright_margin, VA.Drawing.Size shape_size, VA.Drawing.Size padding_size, double expected_pinx, double expected_piny) { var page = doc.Pages.Add(); var pagecells = new VA.Pages.PageCells(); pagecells.PageTopMargin = upperright_margin.Height; pagecells.PageBottomMargin = bottomleft_margin.Height; pagecells.PageLeftMargin = bottomleft_margin.Width; pagecells.PageRightMargin = upperright_margin.Width; var pageupdate = new VA.ShapeSheet.Update(); pageupdate.SetFormulas(pagecells); pageupdate.Execute(page.PageSheet); var shape = page.DrawRectangle(5, 5, 5 + shape_size.Width, 5 + shape_size.Height); page.ResizeToFitContents(padding_size); var xform = VA.Shapes.XFormCells.GetCells(shape); AssertVA.AreEqual(expected_pinx, expected_piny, xform.GetPinPosResult(), 0.1); page.Delete(0); }
protected override void ProcessRecord() { if (this.FitContents) { var bordersize = new VisioAutomation.Drawing.Size(this.BorderWidth, this.BorderWidth); this.client.Page.ResizeToFitContents(bordersize, true); } if (this.Width > 0 || this.Height > 0) { var page = this.client.Application.Get().ActivePage; var pagecells = VisioAutomation.Pages.PageCells.GetCells(page.PageSheet); var newpagecells = new VisioAutomation.Pages.PageCells(); if (this.Width > 0) { newpagecells.PageWidth = this.Width; } if (this.Height > 0) { newpagecells.PageHeight = this.Height; } var update = new VisioAutomation.ShapeSheet.Update(); update.SetFormulas(newpagecells); update.BlastGuards = true; update.Execute(page); } }
protected override void ProcessRecord() { if (this.FitContents) { var bordersize = new VisioAutomation.Drawing.Size(this.BorderWidth, this.BorderWidth); this.Client.Page.ResizeToFitContents(bordersize, true); } if (this.Width > 0 || this.Height > 0) { var page = this.Client.Application.Get().ActivePage; var pagecells = VisioAutomation.Pages.PageCells.GetCells(page.PageSheet); var newpagecells = new VisioAutomation.Pages.PageCells(); if (this.Width > 0) { newpagecells.PageWidth = this.Width; } if (this.Height > 0) { newpagecells.PageHeight = this.Height; } var writer = new FormulaWriterSRC(); newpagecells.SetFormulas(writer); writer.BlastGuards = true; writer.Commit(page); } }
protected override void ProcessRecord() { if (this.FitContents) { var bordersize = new VisioAutomation.Drawing.Size(this.BorderWidth, this.BorderWidth); this.client.Page.ResizeToFitContents(bordersize, true); } if (this.Width > 0 || this.Height > 0) { var page = this.client.Application.Get().ActivePage; var pagecells = VisioAutomation.Pages.PageCells.GetCells(page.PageSheet); var newpagecells = new VisioAutomation.Pages.PageCells(); if (this.Width > 0) { newpagecells.PageWidth = this.Width; } if (this.Height > 0) { newpagecells.PageHeight = this.Height; } var update = new VisioAutomation.ShapeSheet.Update(); update.SetFormulas(newpagecells); update.BlastGuards = true; update.Execute(page); } }
private static void TestResize(IVisio.Document doc, VA.Drawing.Size bottomleft_margin, VA.Drawing.Size upperright_margin, VA.Drawing.Size shape_size, VA.Drawing.Size padding_size, double expected_pinx, double expected_piny) { var page = doc.Pages.Add(); var pagecells = new VA.Pages.PageCells(); pagecells.PageTopMargin = upperright_margin.Height; pagecells.PageBottomMargin = bottomleft_margin.Height; pagecells.PageLeftMargin = bottomleft_margin.Width; pagecells.PageRightMargin = upperright_margin.Width; var pageupdate = new VA.ShapeSheet.Update(); pageupdate.SetFormulas(pagecells); pageupdate.Execute(page.PageSheet); var shape = page.DrawRectangle(5, 5, 5 + shape_size.Width, 5+shape_size.Height); page.ResizeToFitContents(padding_size); var xform = VA.Shapes.XFormCells.GetCells(shape); AssertVA.AreEqual(expected_pinx, expected_piny, xform.Pin(), 0.1); page.Delete(0); }
public IVisio.Page CreatePage(FormPage formpage) { this.FormPage = formpage; this.page = this.VisioPages.Add(); this.page.Name = formpage.Name; // Update the Page Cells var pagesheet = page.PageSheet; var pageupdate = new VA.ShapeSheet.Update(); var pagecells = new VA.Pages.PageCells(); pagecells.PageWidth = formpage.Size.Width; pagecells.PageHeight = formpage.Size.Height; pagecells.PageLeftMargin = formpage.Margin.Left; pagecells.PageRightMargin = formpage.Margin.Right; pagecells.PageTopMargin = formpage.Margin.Top; pagecells.PageBottomMargin = formpage.Margin.Bottom; pageupdate.SetFormulas(pagecells); pageupdate.Execute(pagesheet); this.Reset(); return(this.page); }
public void Apply(IVisio.Page page) { var pagecells = new VA.Pages.PageCells(); this.SetPageCells(pagecells); var update = new VA.ShapeSheet.Update(); update.SetFormulas(pagecells); var pagesheet = page.PageSheet; update.Execute(pagesheet); page.Layout(); }
private static void SetSize(IVisio.Page page, VA.Drawing.Size size) { var page_cells = new VA.Pages.PageCells(); page_cells.PageHeight = size.Height; page_cells.PageWidth = size.Width; var pageupdate = new VA.ShapeSheet.Update(); pageupdate.SetFormulas(page_cells); pageupdate.Execute(page.PageSheet); }
protected virtual void SetPageCells(VisioAutomation.Pages.PageCells pagecells) { pagecells.AvenueSizeX = this.AvenueSize.Width; pagecells.AvenueSizeY = this.AvenueSize.Height; pagecells.LineRouteExt = (int)ConnectorAppearanceToLineRouteExt(this.ConnectorAppearance); var rs = this.ConnectorsStyleToRouteStyle(); if (rs.HasValue) { pagecells.RouteStyle = (int)rs.Value; } }
public void Apply(IVisio.Page page) { var pagecells = new VA.Pages.PageCells(); this.SetPageCells(pagecells); var update = new VA.ShapeSheet.Update(); update.SetFormulas(pagecells); var pagesheet = page.PageSheet; update.Execute(pagesheet); page.Layout(); }
public Page() { this.Shapes = new ShapeList(); this.PageCells = new VA.Pages.PageCells(); this.PerfSettings = new VA.Application.PerfSettings(); this.PerfSettings.DeferRecalc = 0; // By Enable ScreenUpdating by default // If it is disabled it messes up page resizing (there may be a workaround) // TODO: Try the DrawTreeMultiNode2 unit test to see how setting it to 1 will affect the rendering this.PerfSettings.ScreenUpdating = 1; this.PerfSettings.EnableAutoConnect = false; this.PerfSettings.LiveDynamics = false; }
internal IVisio.Page Draw(FormRenderingContext ctx) { var r = new InteractiveRenderer(ctx.Document); var page_cells = new VA.Pages.PageCells(); this.VisioPage = r.CreatePage(this); ctx.Page = this.VisioPage; var titleblock = new TextBlock(new VA.Drawing.Size(7.5, 0.5), this.Title); int _fontid = ctx.GetFontID(this.DefaultFont); titleblock.Textcells.VerticalAlign = 0; titleblock.ParagraphCells.HorizontalAlign = 0; titleblock.FormatCells.LineWeight = 0; titleblock.FormatCells.LinePattern = 0; titleblock.CharacterCells.Font = _fontid; titleblock.CharacterCells.Size = get_pt_string(TitleTextSize); // Draw the shapes var titleshape = r.AddShape(titleblock); r.Linefeed(); double body_height = r.GetDistanceToBottomMargin(); var bodyblock = new TextBlock(new VA.Drawing.Size(7.5, body_height), this.Body); bodyblock.ParagraphCells.HorizontalAlign = 0; bodyblock.ParagraphCells.SpacingAfter = get_pt_string(BodyParaSpacingAfter); bodyblock.CharacterCells.Font = _fontid; bodyblock.CharacterCells.Size = get_pt_string(BodyTextSize); bodyblock.FormatCells.LineWeight = 0; bodyblock.FormatCells.LinePattern = 0; bodyblock.Textcells.VerticalAlign = 0; bodyblock.FormatCells.LineWeight = 0; bodyblock.FormatCells.LinePattern = 0; var bodyshape = r.AddShape(bodyblock); r.Linefeed(); r.Finish(); return(this.VisioPage); }
public Page() { this.Shapes = new ShapeList(); this.PageCells = new VA.Pages.PageCells(); this.PerfSettings = new VA.Application.PerfSettings(); this.PerfSettings.DeferRecalc = 0; // By Enable ScreenUpdating by default // If it is disabled it messes up page resizing (there may be a workaround) // TODO: Try the DrawTreeMultiNode2 unit test to see how setting it to 1 will affect the rendering this.PerfSettings.ScreenUpdating = 1; this.PerfSettings.EnableAutoConnect = false; this.PerfSettings.LiveDynamics = false; }
internal IVisio.Page Draw(FormRenderingContext ctx) { var r = new InteractiveRenderer(ctx.Document); var page_cells = new VA.Pages.PageCells(); this.VisioPage = r.CreatePage(this); ctx.Page = this.VisioPage; var titleblock = new TextBlock(new VA.Drawing.Size(7.5, 0.5), this.Title); int _fontid = ctx.GetFontID(this.DefaultFont); titleblock.Textcells.VerticalAlign = 0; titleblock.ParagraphCells.HorizontalAlign = 0; titleblock.FormatCells.LineWeight = 0; titleblock.FormatCells.LinePattern = 0; titleblock.CharacterCells.Font = _fontid; titleblock.CharacterCells.Size = get_pt_string(TitleTextSize); // Draw the shapes var titleshape = r.AddShape(titleblock); r.Linefeed(); double body_height = r.GetDistanceToBottomMargin(); var bodyblock = new TextBlock(new VA.Drawing.Size(7.5, body_height), this.Body); bodyblock.ParagraphCells.HorizontalAlign = 0; bodyblock.ParagraphCells.SpacingAfter = get_pt_string(BodyParaSpacingAfter); bodyblock.CharacterCells.Font = _fontid; bodyblock.CharacterCells.Size = get_pt_string(BodyTextSize); bodyblock.FormatCells.LineWeight = 0; bodyblock.FormatCells.LinePattern = 0; bodyblock.Textcells.VerticalAlign = 0; bodyblock.FormatCells.LineWeight = 0; bodyblock.FormatCells.LinePattern = 0; var bodyshape = r.AddShape(bodyblock); r.Linefeed(); r.Finish(); return this.VisioPage; }
public VisioAutomation.Pages.PageCells GetCells(System.Collections.Generic.IList <ShapeSheet.CellData <double> > row) { var cells = new VisioAutomation.Pages.PageCells(); cells.PageLeftMargin = row[this.PageLeftMargin]; cells.CenterX = row[this.CenterX]; cells.CenterY = row[this.CenterY]; cells.OnPage = Extensions.CellDataMethods.ToInt(row[this.OnPage]); cells.PageBottomMargin = row[this.PageBottomMargin]; cells.PageRightMargin = row[this.PageRightMargin]; cells.PagesX = row[this.PagesX]; cells.PagesY = row[this.PagesY]; cells.PageTopMargin = row[this.PageTopMargin]; cells.PaperKind = Extensions.CellDataMethods.ToInt(row[this.PaperKind]); cells.PrintGrid = Extensions.CellDataMethods.ToInt(row[this.PrintGrid]); cells.PrintPageOrientation = Extensions.CellDataMethods.ToInt(row[this.PrintPageOrientation]); cells.ScaleX = row[this.ScaleX]; cells.ScaleY = row[this.ScaleY]; cells.PaperSource = Extensions.CellDataMethods.ToInt(row[this.PaperSource]); cells.DrawingScale = row[this.DrawingScale]; cells.DrawingScaleType = Extensions.CellDataMethods.ToInt(row[this.DrawingScaleType]); cells.DrawingSizeType = Extensions.CellDataMethods.ToInt(row[this.DrawingSizeType]); cells.InhibitSnap = Extensions.CellDataMethods.ToInt(row[this.InhibitSnap]); cells.PageHeight = row[this.PageHeight]; cells.PageScale = row[this.PageScale]; cells.PageWidth = row[this.PageWidth]; cells.ShdwObliqueAngle = row[this.ShdwObliqueAngle]; cells.ShdwOffsetX = row[this.ShdwOffsetX]; cells.ShdwOffsetY = row[this.ShdwOffsetY]; cells.ShdwScaleFactor = row[this.ShdwScaleFactor]; cells.ShdwType = Extensions.CellDataMethods.ToInt(row[this.ShdwType]); cells.UIVisibility = row[this.UIVisibility]; cells.XGridDensity = row[this.XGridDensity]; cells.XGridOrigin = row[this.XGridOrigin]; cells.XGridSpacing = row[this.XGridSpacing]; cells.XRulerDensity = row[this.XRulerDensity]; cells.XRulerOrigin = row[this.XRulerOrigin]; cells.YGridDensity = row[this.YGridDensity]; cells.YGridOrigin = row[this.YGridOrigin]; cells.YGridSpacing = row[this.YGridSpacing]; cells.YRulerDensity = row[this.YRulerDensity]; cells.YRulerOrigin = row[this.YRulerOrigin]; cells.AvenueSizeX = row[this.AvenueSizeX]; cells.AvenueSizeY = row[this.AvenueSizeY]; cells.BlockSizeX = row[this.BlockSizeX]; cells.BlockSizeY = row[this.BlockSizeY]; cells.CtrlAsInput = Extensions.CellDataMethods.ToInt(row[this.CtrlAsInput]); cells.DynamicsOff = Extensions.CellDataMethods.ToInt(row[this.DynamicsOff]); cells.EnableGrid = Extensions.CellDataMethods.ToInt(row[this.EnableGrid]); cells.LineAdjustFrom = Extensions.CellDataMethods.ToInt(row[this.LineAdjustFrom]); cells.LineAdjustTo = row[this.LineAdjustTo]; cells.LineJumpCode = row[this.LineJumpCode]; cells.LineJumpFactorX = row[this.LineJumpFactorX]; cells.LineJumpFactorY = row[this.LineJumpFactorY]; cells.LineJumpStyle = Extensions.CellDataMethods.ToInt(row[this.LineJumpStyle]); cells.LineRouteExt = row[this.LineRouteExt]; cells.LineToLineX = row[this.LineToLineX]; cells.LineToLineY = row[this.LineToLineY]; cells.LineToNodeX = row[this.LineToNodeX]; cells.LineToNodeY = row[this.LineToNodeY]; cells.PageLineJumpDirX = row[this.PageLineJumpDirX]; cells.PageLineJumpDirY = row[this.PageLineJumpDirY]; cells.PageShapeSplit = Extensions.CellDataMethods.ToInt(row[this.PageShapeSplit]); cells.PlaceDepth = Extensions.CellDataMethods.ToInt(row[this.PlaceDepth]); cells.PlaceFlip = Extensions.CellDataMethods.ToInt(row[this.PlaceFlip]); cells.PlaceStyle = Extensions.CellDataMethods.ToInt(row[this.PlaceStyle]); cells.PlowCode = Extensions.CellDataMethods.ToInt(row[this.PlowCode]); cells.ResizePage = Extensions.CellDataMethods.ToInt(row[this.ResizePage]); cells.RouteStyle = Extensions.CellDataMethods.ToInt(row[this.RouteStyle]); cells.AvoidPageBreaks = Extensions.CellDataMethods.ToInt(row[this.AvoidPageBreaks]); cells.DrawingResizeType = Extensions.CellDataMethods.ToInt(row[this.DrawingResizeType]); return(cells); }
public IVisio.Page CreatePage(FormPage formpage) { this.FormPage = formpage; this.page = this.VisioPages.Add(); this.page.Name = formpage.Name; // Update the Page Cells var pagesheet = page.PageSheet; var pageupdate = new VA.ShapeSheet.Update(); var pagecells = new VA.Pages.PageCells(); pagecells.PageWidth = formpage.Size.Width; pagecells.PageHeight = formpage.Size.Height; pagecells.PageLeftMargin = formpage.Margin.Left; pagecells.PageRightMargin = formpage.Margin.Right; pagecells.PageTopMargin = formpage.Margin.Top; pagecells.PageBottomMargin = formpage.Margin.Bottom; pageupdate.SetFormulas(pagecells); pageupdate.Execute(pagesheet); this.Reset(); return this.page; }
protected override void SetPageCells(VisioAutomation.Pages.PageCells pagecells) { base.SetPageCells(pagecells); pagecells.PlaceStyle = (int)GetPlaceStyle(this.Direction); }
protected override void SetPageCells(VisioAutomation.Pages.PageCells pagecells) { base.SetPageCells(pagecells); pagecells.PlaceStyle = (int)IVisio.VisCellVals.visPLOPlaceCircular; }
protected override void SetPageCells(VisioAutomation.Pages.PageCells pagecells) { base.SetPageCells(pagecells); pagecells.PlaceStyle = (int)GetPlaceStyle(this.Direction, this.HorizontalAlignment, this.VerticalAlignment); }
private static void SetSize(IVisio.Page page, VA.Drawing.Size size) { var page_cells = new VA.Pages.PageCells(); page_cells.PageHeight = size.Height; page_cells.PageWidth = size.Width; var pageupdate = new VA.ShapeSheet.Update(); pageupdate.SetFormulas(page_cells); pageupdate.Execute(page.PageSheet); }
public VisioAutomation.Pages.PageCells GetCells(System.Collections.Generic.IList<ShapeSheet.CellData<double>> row) { var cells = new VisioAutomation.Pages.PageCells(); cells.PageLeftMargin = row[this.PageLeftMargin]; cells.CenterX = row[this.CenterX]; cells.CenterY = row[this.CenterY]; cells.OnPage = Extensions.CellDataMethods.ToInt(row[this.OnPage]); cells.PageBottomMargin = row[this.PageBottomMargin]; cells.PageRightMargin = row[this.PageRightMargin]; cells.PagesX = row[this.PagesX]; cells.PagesY = row[this.PagesY]; cells.PageTopMargin = row[this.PageTopMargin]; cells.PaperKind = Extensions.CellDataMethods.ToInt(row[this.PaperKind]); cells.PrintGrid = Extensions.CellDataMethods.ToInt(row[this.PrintGrid]); cells.PrintPageOrientation = Extensions.CellDataMethods.ToInt(row[this.PrintPageOrientation]); cells.ScaleX = row[this.ScaleX]; cells.ScaleY = row[this.ScaleY]; cells.PaperSource = Extensions.CellDataMethods.ToInt(row[this.PaperSource]); cells.DrawingScale = row[this.DrawingScale]; cells.DrawingScaleType = Extensions.CellDataMethods.ToInt(row[this.DrawingScaleType]); cells.DrawingSizeType = Extensions.CellDataMethods.ToInt(row[this.DrawingSizeType]); cells.InhibitSnap = Extensions.CellDataMethods.ToInt(row[this.InhibitSnap]); cells.PageHeight = row[this.PageHeight]; cells.PageScale = row[this.PageScale]; cells.PageWidth = row[this.PageWidth]; cells.ShdwObliqueAngle = row[this.ShdwObliqueAngle]; cells.ShdwOffsetX = row[this.ShdwOffsetX]; cells.ShdwOffsetY = row[this.ShdwOffsetY]; cells.ShdwScaleFactor = row[this.ShdwScaleFactor]; cells.ShdwType = Extensions.CellDataMethods.ToInt(row[this.ShdwType]); cells.UIVisibility = row[this.UIVisibility]; cells.XGridDensity = row[this.XGridDensity]; cells.XGridOrigin = row[this.XGridOrigin]; cells.XGridSpacing = row[this.XGridSpacing]; cells.XRulerDensity = row[this.XRulerDensity]; cells.XRulerOrigin = row[this.XRulerOrigin]; cells.YGridDensity = row[this.YGridDensity]; cells.YGridOrigin = row[this.YGridOrigin]; cells.YGridSpacing = row[this.YGridSpacing]; cells.YRulerDensity = row[this.YRulerDensity]; cells.YRulerOrigin = row[this.YRulerOrigin]; cells.AvenueSizeX = row[this.AvenueSizeX]; cells.AvenueSizeY = row[this.AvenueSizeY]; cells.BlockSizeX = row[this.BlockSizeX]; cells.BlockSizeY = row[this.BlockSizeY]; cells.CtrlAsInput = Extensions.CellDataMethods.ToInt(row[this.CtrlAsInput]); cells.DynamicsOff = Extensions.CellDataMethods.ToInt(row[this.DynamicsOff]); cells.EnableGrid = Extensions.CellDataMethods.ToInt(row[this.EnableGrid]); cells.LineAdjustFrom = Extensions.CellDataMethods.ToInt(row[this.LineAdjustFrom]); cells.LineAdjustTo = row[this.LineAdjustTo]; cells.LineJumpCode = row[this.LineJumpCode]; cells.LineJumpFactorX = row[this.LineJumpFactorX]; cells.LineJumpFactorY = row[this.LineJumpFactorY]; cells.LineJumpStyle = Extensions.CellDataMethods.ToInt(row[this.LineJumpStyle]); cells.LineRouteExt = row[this.LineRouteExt]; cells.LineToLineX = row[this.LineToLineX]; cells.LineToLineY = row[this.LineToLineY]; cells.LineToNodeX = row[this.LineToNodeX]; cells.LineToNodeY = row[this.LineToNodeY]; cells.PageLineJumpDirX = row[this.PageLineJumpDirX]; cells.PageLineJumpDirY = row[this.PageLineJumpDirY]; cells.PageShapeSplit = Extensions.CellDataMethods.ToInt(row[this.PageShapeSplit]); cells.PlaceDepth = Extensions.CellDataMethods.ToInt(row[this.PlaceDepth]); cells.PlaceFlip = Extensions.CellDataMethods.ToInt(row[this.PlaceFlip]); cells.PlaceStyle = Extensions.CellDataMethods.ToInt(row[this.PlaceStyle]); cells.PlowCode = Extensions.CellDataMethods.ToInt(row[this.PlowCode]); cells.ResizePage = Extensions.CellDataMethods.ToInt(row[this.ResizePage]); cells.RouteStyle = Extensions.CellDataMethods.ToInt(row[this.RouteStyle]); cells.AvoidPageBreaks = Extensions.CellDataMethods.ToInt(row[this.AvoidPageBreaks]); cells.DrawingResizeType = Extensions.CellDataMethods.ToInt(row[this.DrawingResizeType]); return cells; }