Ejemplo n.º 1
0
        public static Page GetPage04_Simple_Text(Drawing doc)
        {
            var page = new Page(8, 4);
            doc.Pages.Add(page);

            // find the id of the master for rounded rectangles
            int rounded_rect_id = doc.GetMasterMetaData("Rounded REctAngle").ID;

            var shape1 = new Shape(rounded_rect_id, 1, 3);
            page.Shapes.Add(shape1);
            shape1.Text.Add("Page4Shape1");

            var shape2 = new Shape(rounded_rect_id, 5, 3);
            page.Shapes.Add(shape2);
            shape2.Text.Add("Page4Shape2");

            var shape3 = Shape.CreateDynamicConnector(doc);
            shape3.XForm1D.EndY.Result = 0;

            shape3.Line = new Line();
            shape3.Line.EndArrow.Result = 3;

            page.Shapes.Add(shape3);

            page.ConnectShapesViaConnector(shape3, shape1, shape2);
            return page;
        }
Ejemplo n.º 2
0
        public static Page GetPage10_layers(Drawing doc)
        {
            var page = new Page(8, 4);
            doc.Pages.Add(page);

            var layer0 = page.AddLayer("Layer0", 0);
            var layer1 = page.AddLayer("Layer1", 1);
            var layer2 = page.AddLayer("Layer2", 2);

            // find the id of the master for rounded rectangles
            int rounded_rect_id = doc.GetMasterMetaData("Rounded REctAngle").ID;

            var layout = new Layout();
            layout.ShapeRouteStyle.Result = RouteStyle.TreeEW;

            var shape1 = new Shape(rounded_rect_id, 1, 3);
            page.Shapes.Add(shape1);
            shape1.Text.Add("Shape1");

            shape1.Layout = layout;

            var shape2 = new Shape(rounded_rect_id, 5, 3);
            page.Shapes.Add(shape2);
            shape2.Text.Add("Shape2");

            shape2.Layout = shape1.Layout;

            var shape3 = Shape.CreateDynamicConnector(doc);
            shape3.XForm1D.EndY.Result = 0;
            page.Shapes.Add(shape3);
            shape3.Geom = new Geom();
            shape3.Geom.Rows.Add(new MoveTo(1, 3));
            shape3.Geom.Rows.Add(new LineTo(5, 3));

            shape3.Layout = shape1.Layout;
            page.ConnectShapesViaConnector(shape3, shape1, shape2);

            shape3.LayerMembership = new List<int> {layer0.Index, layer2.Index};
            shape1.LayerMembership = new List<int> {layer1.Index};
            shape2.LayerMembership = new List<int> {layer2.Index};

            return page;
        }
Ejemplo n.º 3
0
        public static Page GetPage14_Hyperlinks(Drawing doc)
        {
            var page = new Page(8, 4);
            doc.Pages.Add(page);

            // find the id of the master for rounded rectangles
            int rounded_rect_id = doc.GetMasterMetaData("Rounded REctAngle").ID;

            var shape1 = new Shape(rounded_rect_id, 1, 3);
            shape1.Text.Add("No Hyperlinks");

            var shape2 = new Shape(rounded_rect_id, 5, 3);
            shape2.Text.Add("1 Hyperlink");
            shape2.Hyperlinks = new List<Hyperlink>();
            shape2.Hyperlinks.Add(new Hyperlink("Google", "http://google.com"));

            var shape3 = new Shape(rounded_rect_id, 5, 3);
            shape3.Text.Add("2 Hyperlinks");
            shape3.Hyperlinks = new List<Hyperlink>();
            shape3.Hyperlinks.Add(new Hyperlink("Google", "http://google.com"));
            shape3.Hyperlinks.Add(new Hyperlink("Microsoft", "http://microsoft.com"));

            page.Shapes.Add(shape1);
            page.Shapes.Add(shape2);
            page.Shapes.Add(shape3);

            page.ConnectShapesViaConnector(shape3, shape1, shape2);
            return page;
        }
Ejemplo n.º 4
0
        public static Page GetPage09_Layout(Drawing doc)
        {
            var page = new Page(8, 4);
            doc.Pages.Add(page);

            // find the id of the master for rounded rectangles
            int rounded_rect_id = doc.GetMasterMetaData("Rounded REctAngle").ID;

            var layout = new Layout();
            layout.ShapeRouteStyle.Result = RouteStyle.TreeEW;

            var shape1 = new Shape(rounded_rect_id, 1, 3);
            page.Shapes.Add(shape1);
            shape1.Text.Add("XXX1");

            shape1.Layout = layout;

            var shape2 = new Shape(rounded_rect_id, 5, 3);
            page.Shapes.Add(shape2);
            shape2.Text.Add("XXX2");

            shape2.Layout = shape1.Layout;

            var shape3 = Shape.CreateDynamicConnector(doc);
            shape3.XForm1D.EndY.Result = 0;
            page.Shapes.Add(shape3);
            shape3.Geom = new Geom();
            shape3.Geom.Rows.Add(new MoveTo(1, 3));
            shape3.Geom.Rows.Add(new LineTo(5, 3));

            shape3.Layout = shape1.Layout;
            page.ConnectShapesViaConnector(shape3, shape1, shape2);
            return page;
        }