public void DrawXmlModel(VisioScripting.TargetPage targetpage, VisioAutomation.Models.Data.XmlModel xmlmodel) { targetpage = targetpage.ResolveToPage(this._client); var tree_drawing = new VisioAutomation.Models.Layouts.Tree.Drawing(); this._build_from_xml_doc(xmlmodel.XmlDocument, tree_drawing); tree_drawing.Render(targetpage.Page); }
protected override void ProcessRecord() { if (this.OrgChart != null) { this.Client.Draw.OrgChart(this.OrgChart); } else if (this.GridLayout != null) { this.Client.Draw.Grid(this.GridLayout); } else if (this.DirectedGraphs != null) { this.Client.Draw.DirectedGraph(this.DirectedGraphs); } else if (this.DataTable != null) { var widths = Enumerable.Repeat <double>(this.CellWidth, this.DataTable.Columns.Count).ToList(); var heights = Enumerable.Repeat <double>(this.CellHeight, this.DataTable.Rows.Count).ToList(); var spacing = new VisioAutomation.Geometry.Size(this.CellSpacing, this.CellSpacing); var shapes = this.Client.Draw.Table(this.DataTable, widths, heights, spacing); this.WriteObject(shapes); } else if (this.PieChart != null) { this.Client.Draw.PieChart(this.PieChart); } else if (this.BarChart != null) { this.Client.Draw.BarChart(this.BarChart); } else if (this.AreaChart != null) { this.Client.Draw.AreaChart(this.AreaChart); } else if (this.XmlDocument != null) { this.WriteVerbose("XmlDocument"); var tree_drawing = new VA.Models.Layouts.Tree.Drawing(); this.build_from_xml_doc(this.XmlDocument, tree_drawing); tree_drawing.Render(this.Client.Page.Get()); } else { this.WriteVerbose("No object to draw"); } }
protected override void ProcessRecord() { var app = this.Client.Application.GetActiveApplication(); if (app == null) { string msg = "A Visio Application Instance is not attached"; this.WriteVerbose(msg); throw new System.ArgumentOutOfRangeException(msg); } if (this.OrgChart != null) { this.Client.Charting.NewOrgChartDocument(this.OrgChart); } else if (this.GridLayout != null) { this.Client.Charting.DrawGridOnActivePage(this.GridLayout); } else if (this.DirectedGraphs != null) { this.Client.Charting.NewDirectedGraphDocument(this.DirectedGraphs); } else if (this.DataTable != null) { var widths = Enumerable.Repeat <double>(this.CellWidth, this.DataTable.Columns.Count).ToList(); var heights = Enumerable.Repeat <double>(this.CellHeight, this.DataTable.Rows.Count).ToList(); var spacing = new VisioAutomation.Geometry.Size(this.CellSpacing, this.CellSpacing); var shapes = this.Client.Charting.NewDataTablePageInActiveDocument(this.DataTable, widths, heights, spacing); this.WriteObject(shapes); } else if (this.XmlDocument != null) { this.WriteVerbose("XmlDocument"); var tree_drawing = new VisioAutomation.Models.Layouts.Tree.Drawing(); this.build_from_xml_doc(this.XmlDocument, tree_drawing); tree_drawing.Render(this.Client.Page.GetActivePage()); } else { this.WriteVerbose("No object to draw"); } }