DeleteHeaderFooterShapes
Section.DeleteHeaderFooterShapes method
Bu bölümün başlık ve altbilgilerinden tüm şekilleri (çizim nesnelerini) siler.
public void DeleteHeaderFooterShapes()
Örnekler
Bir bölümdeki tüm üstbilgi ve altbilgilerden tüm şekillerin nasıl kaldırılacağını gösterir.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Bir şekil ile birincil başlığı oluştur.
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.InsertShape(ShapeType.Rectangle, 100, 100);
// Bir resimle birincil altbilgi oluşturun.
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.InsertImage(ImageDir + "Logo icon.ico");
Assert.AreEqual(1, doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary].GetChildNodes(NodeType.Shape, true).Count);
Assert.AreEqual(1, doc.FirstSection.HeadersFooters[HeaderFooterType.FooterPrimary].GetChildNodes(NodeType.Shape, true).Count);
// İlk bölümdeki başlık ve altbilgilerden tüm şekilleri kaldırın.
doc.FirstSection.DeleteHeaderFooterShapes();
Assert.AreEqual(0, doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary].GetChildNodes(NodeType.Shape, true).Count);
Assert.AreEqual(0, doc.FirstSection.HeadersFooters[HeaderFooterType.FooterPrimary].GetChildNodes(NodeType.Shape, true).Count);
Ayrıca bakınız
- class Section
- ad alanı Aspose.Words
- toplantı Aspose.Words