AFAnalysisRules.Swap Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Swap the items in the collection by specified index.
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void Swap( int firstIndex, int secondIndex )
Public Sub Swap ( firstIndex As Integer, secondIndex As Integer ) Dim instance As AFAnalysisRules Dim firstIndex As Integer Dim secondIndex As Integer instance.Swap(firstIndex, secondIndex)
public: void Swap( int firstIndex, int secondIndex )
member Swap : firstIndex : int * secondIndex : int -> unit
Parameters
- firstIndex
- Type: SystemInt32
The index into the collection of the first item in the collection to be swapped with the second item. - secondIndex
- Type: SystemInt32
The index into the collection of the second item in the collection to be swapped with the first item.
Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | If the size of the collection is too large to perform the operation. This occurs when the number of items in the collection is greater than a page size and the IsPaging property is . |
Remarks
The two items in the collection specified by the firstIndex
and secondIndex parameters are swapped. They exchange places
in the collection.