Aspose.Words.Examples.CSharp.Programming_Documents.Working_With_Document.CreateHeaderFooterUsingDocBuilder.CopyHeadersFootersFromPreviousSection C# (CSharp) Method

CopyHeadersFootersFromPreviousSection() private static method

Clones and copies headers/footers form the previous section to the specified section.
private static CopyHeadersFootersFromPreviousSection ( Section section ) : void
section Section
return void
        private static void CopyHeadersFootersFromPreviousSection(Section section)
        {
            Section previousSection = (Section)section.PreviousSibling;

            if (previousSection == null)
                return;

            section.HeadersFooters.Clear();

            foreach (HeaderFooter headerFooter in previousSection.HeadersFooters)
                section.HeadersFooters.Add(headerFooter.Clone(true));
        }
        // ExEnd:CopyHeadersFootersFromPreviousSection
CreateHeaderFooterUsingDocBuilder