AdvisableCollection<T>.MoveItem Method |
Moves the element at the specified index to another index in the underlying collection.
Namespace: PostSharp.Patterns.Collections
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
protected virtual void MoveItem( T item, int oldIndex, int newIndex )
Parameters
- item
- Type: T
The element to be moved. - oldIndex
- Type: System.Int32
The old zero-based index of item in the collection. - newIndex
- Type: System.Int32
The new zero-based index of item in the collection.
Some redundancy is created by requiring both item and oldIndex: this is intentional, for performance reasons.
This method does not cause the advices to be executed. It should be invoked only from inside the scope of the ExecuteWithAdvices method. |