GetEnumerator Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Returns an enumerator that can be used to iterate through the collection.
Syntax
public HeaderFooterCollection.HeaderFooterEnumerator GetEnumerator();Public Function GetEnumerator() As HeaderFooterCollection.HeaderFooterEnumeratorReturn 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;
}Dim headersAndFooters As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headersAndFooters.Add(HeaderFooterType.Header)
Dim enumerator As IEnumerator = headersAndFooters.GetEnumerator()
While enumerator.MoveNext()
Dim part As HeaderFooter = DirectCast(enumerator.Current, HeaderFooter)
part.Selection.Bold = True
End While