TX Text Control .NET Server

HeaderFooterCollection Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Implements
ICollection, IEnumerable

Description

An instance of the HeaderFooterCollection class contains the headers and footers in a Text Control document represented through objects of the type HeaderFooter. An instance of this class can be either obtained through the TextControl.HeadersAndFooters or through the Section.HeadersAndFooters property. The first collection represents headers and footers common to all sections of the document and the second collection represents the headers and footers of a certain section. The HeaderFooterCollection class implements the IEnumerable and the ICollection interface.

Syntax

public class HeaderFooterCollection : ICollection, IEnumerable

Examples

The following example works with headers and footers in the current document.

HeaderFooterCollection headerFooterCollection = textControl.HeadersAndFooters;
headerFooterCollection.Add(HeaderFooterType.Header);

Members

Properties

PropertyDescription
CountGets the number of elements contained in the collection.

Methods

MethodDescription
AddAdds a new header or footer to a Text Control document or to a certain section of the document. If a header or footer is added to the complete document the first section receives the header or footer and all other sections receive headers or footers which are connected to their previous section. To add more than one header or footer a combination of the HeaderFooterType enumeration values can be used.
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection.
GetItemGets a particular header or footer from the collection. If the specified header or footer does not exist in the collection an ArgumentException is thrown.
RemoveRemoves a header or footer from a Text Control document or from a certain section. To remove more than one header or footer a combination of the HeaderFooterType enumeration can be used.