private void build_from_xml_doc(System.Xml.XmlDocument xmlDocument, VA.Models.Tree.Drawing tree_drawing) { var n = new VA.Models.Tree.Node(); tree_drawing.Root = n; n.Text = new VA.Text.Markup.TextElement(xmlDocument.Name); this.build_from_xml_element(xmlDocument.DocumentElement, n); }
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>(CellWidth, DataTable.Columns.Count).ToList(); var heights = Enumerable.Repeat <double>(CellHeight, DataTable.Rows.Count).ToList(); var spacing = new VA.Drawing.Size(CellSpacing, CellSpacing); var shapes = this.client.Draw.Table(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.Tree.Drawing(); 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() { 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.Drawing.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 VisioAutomation.Models.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"); } }