Пример #1
0
        public void SectionDeleteHeaderFooterShapes()
        {
            //ExStart
            //ExFor:Section.DeleteHeaderFooterShapes
            //ExSummary:Removes all images and shapes from all headers footers in a section.
            Document     doc         = new Document();
            Section      section     = doc.Sections[0];
            HeaderFooter firstHeader = new HeaderFooter(doc, HeaderFooterType.HeaderFirst);

            section.HeadersFooters.Add(firstHeader);

            firstHeader.AppendParagraph("This paragraph contains a shape: ");

            Shape shape = new Shape(doc, ShapeType.Arrow);

            firstHeader.FirstParagraph.AppendChild(shape);

            Assert.AreEqual(1, firstHeader.GetChildNodes(NodeType.Shape, true).Count);

            section.DeleteHeaderFooterShapes();

            Assert.AreEqual(0, firstHeader.GetChildNodes(NodeType.Shape, true).Count);
            //ExEnd
        }