ParserErrorCollection.CopyTo Method

Note: This method is new in the .NET Framework version 2.0.

Copies the ParserError objects in the collection to a compatible one-dimensional array, starting at the specified index of the target array.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public:
void CopyTo (
	array<ParserError^>^ array, 
	int index
)
public void CopyTo (
	ParserError[] array, 
	int index
)
public function CopyTo (
	array : ParserError[], 
	index : int
)

Parameters

array

An array of type ParserError to which the parser errors in the collection are copied.

index

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:

  1. Copy the ParserError objects into a compatible array.

  2. Sort the array.

  3. Use the Remove method to remove all the ParserError objects from the collection.

  4. 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.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: