public void Dom_DrawOrgChart()
        {
            var app     = this.GetVisioApplication();
            var vis_ver = VA.Application.ApplicationHelper.GetVersion(app);

            // How to draw using a Template instead of a doc and a stencil
            string orgchart_vst         = "orgchart.vst";
            string position_master_name = vis_ver.Major >= 15 ? "Position Belt" : "Position";

            var doc_node  = new VADOM.Document(orgchart_vst, IVisio.VisMeasurementSystem.visMSUS);
            var page_node = new VADOM.Page();

            doc_node.Pages.Add(page_node);

            // Have to be smart about selecting the right master with Visio 2013

            var s1 = new VADOM.Shape(position_master_name, null, new VA.Geometry.Point(3, 8));

            page_node.Shapes.Add(s1);

            var s2 = new VADOM.Shape(position_master_name, null, new VA.Geometry.Point(0, 4));

            page_node.Shapes.Add(s2);

            var s3 = new VADOM.Shape(position_master_name, null, new VA.Geometry.Point(6, 4));

            page_node.Shapes.Add(s3);

            page_node.Shapes.Connect(this.edge_master_name, this.edge_stencil_name, s1, s2);
            page_node.Shapes.Connect(this.edge_master_name, this.edge_stencil_name, s1, s3);

            var doc = doc_node.Render(app);

            doc.Close(true);
        }
        public void Dom_RenderDocumentToApplication()
        {
            // Rendering a dom document to an appliction instance should create a new document
            var app       = this.GetVisioApplication();
            var doc_node  = new VADOM.Document();
            var page_node = new VADOM.Page();

            doc_node.Pages.Add(page_node);
            int old_count = app.Documents.Count;
            var newdoc    = doc_node.Render(app);

            Assert.AreEqual(old_count + 1, app.Documents.Count);
            Assert.AreEqual(1, newdoc.Pages.Count);
            app.ActiveDocument.Close(true);
        }