Ejemplo n.º 1
0
        public void Container_Diagram2()
        {
            // Make sure that empty containers can be drawn
            var doc = this.GetNewDoc();

            var layout1  = new ContainerLayout();
            var l1_c1    = layout1.AddContainer("L1/C1");
            var l1_c1_i1 = l1_c1.Add("L1/C1/I1");
            var l1_c2    = layout1.AddContainer("L1/C2"); // this is the empty container

            layout1.PerformLayout();
            var page1 = layout1.Render(doc);

            page1.Delete(0);
            doc.Close(true);
        }
Ejemplo n.º 2
0
        public void Container_PerformLayoutBeforeRender()
        {
            // Purpose: Verify that if PerformLayout is NOT called before Render()
            // is called then an exception will be thrown

            bool caught = false;
            var  layout = new ContainerLayout();
            var  doc    = this.GetNewDoc();

            try
            {
                var c1 = layout.AddContainer("A");
                var i1 = c1.Add("A1");
                // layout.PerformLayout();
                IVisio.Page page = layout.Render(doc);
                page.Delete(0);
            }
            catch (System.ArgumentException)
            {
                caught = true;
            }

            doc.Close(true);

            if (caught == false)
            {
                Assert.Fail("Did not catch expected exception");
            }
        }
        public static void SimpleContainer()
        {
            var m = new ContainerLayout();

            var c1 = m.AddContainer("Container 1");
            var c2 = m.AddContainer("Container 2");

            c1.Add("A");

            c1.Add("B");
            c1.Add("C");

            c2.Add("1");
            c2.Add("2");
            c2.Add("3");

            m.LayoutOptions = new LayoutOptions();
            m.LayoutOptions.ContainerFormatting.ShapeFormatCells.FillForeground     = "rgb(0,176,240)";
            m.LayoutOptions.ContainerItemFormatting.ShapeFormatCells.FillForeground = "rgb(250,250,250)";
            m.LayoutOptions.ContainerItemFormatting.ShapeFormatCells.LinePattern    = "0";

            m.PerformLayout();
            m.Render(SampleEnvironment.Application.ActiveDocument);
        }
Ejemplo n.º 4
0
        public void Container_Diagram1()
        {
            // Purpose: Simple test to make sure that both Containers and Non-Container
            // rendering are supported. The diagram is a single container having a single
            // container item

            var doc = this.GetNewDoc();

            var layout1  = new ContainerLayout();
            var l1_c1    = layout1.AddContainer("L1/C1");
            var l1_c1_i1 = l1_c1.Add("L1/C1/I1");

            layout1.PerformLayout();
            var page1 = layout1.Render(doc);

            page1.Delete(0);

            doc.Close(true);
        }