ParserErrorCollection::CopyTo Method
Copies the ParserError objects in the collection to a compatible one-dimensional array, starting at the specified index of the target array.
Assembly: System.Web (in System.Web.dll)
Parameters
- array
- Type: array<System.Web::ParserError>
An array of type ParserError to which the parser errors in the collection are copied.
- index
- Type: System::Int32
The first index within the array to which the ParserError is copied.
Use the CopyTo method to copy the ParserError objects in a collection (including the item references they contain) to a compatible array, starting at a specified index. This is useful when you want to sort the ParserError objects in the collection by using the Sort method. To do this:
Copy the ParserError objects into a compatible array.
Sort the array.
Use the Remove method to remove all the ParserError objects from the collection.
Use the AddRange method to add the sorted array back to the collection.
The following code example demonstrates how to copy the contents of a ParserErrorCollection object to the specified ParserError array.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.