TX Text Control .NET Server

GetEnumerator Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Returns an enumerator that can be used to iterate through the collection.

Syntax

public HeaderFooterCollection.HeaderFooterEnumerator GetEnumerator();

Return Value

The return value is an IEnumerator that represents the collection.

Examples

The following example explicitly enumerates all header/footer variants and makes their text bold.

HeaderFooterCollection headersAndFooters = textControl.Sections[1].HeadersAndFooters;
headersAndFooters.Add(HeaderFooterType.Header);
IEnumerator enumerator = headersAndFooters.GetEnumerator();
while (enumerator.MoveNext())
{
    HeaderFooter part = (HeaderFooter)enumerator.Current;
    part.Selection.Bold = true;
}