示例#1
0
        private void _build_from_xml_doc(System.Xml.XmlDocument xml_document, VisioAutomation.Models.Layouts.Tree.Drawing tree_drawing)
        {
            var n = new VisioAutomation.Models.Layouts.Tree.Node();

            tree_drawing.Root = n;
            n.Text            = new VisioAutomation.Models.Text.Element(xml_document.Name);
            this._build_from_xml_element(xml_document.DocumentElement, n);
        }
示例#2
0
        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);
        }
示例#3
0
        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");
            }
        }
示例#4
0
        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");
            }
        }