Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

PIIdentities.CopyTo Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
PIIdentities.CopyTo Method
Copies the entire collection to a compatible one-dimensional Array, starting at the specified index of the target array.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public void CopyTo(
	PIIdentity[] array,
	int index
)
Public Sub CopyTo ( 
	array As PIIdentity(),
	index As Integer
)

Dim instance As PIIdentities
Dim array As PIIdentity()
Dim index As Integer

instance.CopyTo(array, index)
public:
virtual void CopyTo(
	array<PIIdentity^>^ array, 
	int index
) sealed
abstract CopyTo : 
        array : PIIdentity[] * 
        index : int -> unit 
override CopyTo : 
        array : PIIdentity[] * 
        index : int -> unit 

Parameters

array
Type: OSIsoft.AF.PIPIIdentity
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

ExceptionCondition
ArgumentNullExceptionarray is .
ArgumentOutOfRangeExceptionindex is less than zero.
ArgumentExceptionarray 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.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in