TX Text Control .NET for Windows Forms

CopyTo Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Copies the elements of the collection to an array, starting at a particular index.

Syntax

public override void CopyTo(Array array, int index);

Parameters

ParameterDescription
array

Specifies the array to copy to.

index

Specifies the index of the destination array at which to begin copying.

Examples

The following example copies page-number fields to an array before applying a consistent number format.

textControl.HeadersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = textControl.HeadersAndFooters.GetItem(HeaderFooterType.Footer);
PageNumberFieldCollection fields = footer.PageNumberFields;
fields.Add(new PageNumberField());
PageNumberField[] snapshot = new PageNumberField[fields.Count];
fields.CopyTo(snapshot, 0);
foreach (PageNumberField field in snapshot)
{
    field.NumberFormat = NumberFormat.ArabicNumbers;
}