[Test] //ExSkip public void GroupOfShapes() { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); GroupShape group = new GroupShape(doc); Assert.AreEqual(0, group.ChildNodes.Count); Shape balloon = new Shape(doc, ShapeType.Balloon); balloon.Width = 200; balloon.Height = 200; balloon.Stroke.Color = Color.Red; Shape cube = new Shape(doc, ShapeType.Cube); cube.Width = 100; cube.Height = 100; cube.Stroke.Color = Color.Blue; group.AppendChild(balloon); group.AppendChild(cube); builder.InsertNode(group); ShapeInfoPrinter printer = new ShapeInfoPrinter(); group.Accept(printer); Console.WriteLine(printer.GetText()); }
[Test] //ExSkip public void GroupOfShapes() { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape balloon = new Shape(doc, ShapeType.Balloon) { Width = 200, Height = 200, Stroke = { Color = Color.Red } }; Shape cube = new Shape(doc, ShapeType.Cube) { Width = 100, Height = 100, Stroke = { Color = Color.Blue } }; GroupShape group = new GroupShape(doc); group.AppendChild(balloon); group.AppendChild(cube); Assert.True(group.IsGroup); builder.InsertNode(group); ShapeInfoPrinter printer = new ShapeInfoPrinter(); group.Accept(printer); Console.WriteLine(printer.GetText()); }
[Test] //ExSkip public void GroupOfShapes() { Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // If you need to create "NonPrimitive" shapes, like SingleCornerSnipped, TopCornersSnipped, DiagonalCornersSnipped, // TopCornersOneRoundedOneSnipped, SingleCornerRounded, TopCornersRounded, DiagonalCornersRounded // please use DocumentBuilder.InsertShape methods Shape balloon = new Shape(doc, ShapeType.Balloon) { Width = 200, Height = 200, Stroke = { Color = Color.Red } }; Shape cube = new Shape(doc, ShapeType.Cube) { Width = 100, Height = 100, Stroke = { Color = Color.Blue } }; GroupShape group = new GroupShape(doc); group.AppendChild(balloon); group.AppendChild(cube); Assert.True(group.IsGroup); builder.InsertNode(group); ShapeInfoPrinter printer = new ShapeInfoPrinter(); group.Accept(printer); Console.WriteLine(printer.GetText()); TestGroupShapes(doc); //ExSkip }