PISystems.CopyTo Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Copies the entire collection to a compatible one-dimensional Array,
starting at the specified index of the target array.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void CopyTo( PISystem[] array, int index )
Public Sub CopyTo ( array As PISystem(), index As Integer ) Dim instance As PISystems Dim array As PISystem() Dim index As Integer instance.CopyTo(array, index)
public: virtual void CopyTo( array<PISystem^>^ array, int index ) sealed
abstract CopyTo : array : PISystem[] * index : int -> unit override CopyTo : array : PISystem[] * index : int -> unit
Parameters
- array
- Type: OSIsoft.AFPISystem
The one-dimensional Array that is the destination of the items copied from the collection. The Array must have zero-based indexing. - index
- Type: SystemInt32
The zero-based index in array at which copying begins.
Implements
ICollectionTCopyTo(T, Int32)
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | array is . |
| ArgumentOutOfRangeException | index is less than zero. |
| ArgumentException | array is multidimensional, does not have zero-based indexing, the number of elements in the source collection is greater than the available space from index to the end of the destination array, or type T is not assignable to the item type of the destination array. |
Remarks
This method uses System.Array.Copy to copy the items.
The elements are copied to the Array in the same order in which the enumerator iterates through the collection.
This method is an O(n) operation, where n is Count.