Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Collections Namespace / Advisable­Collection(T) Class / Advisable­Collection(T) Methods / Advisable­Collection(T).​Move­Item Method

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: 5.0.48.0 (5.0.48.0)
Syntax
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.
Remarks

Some redundancy is created by requiring both item and oldIndex: this is intentional, for performance reasons.

Remarks

Note Note
This method does not cause the advices to be executed. It should be invoked only from inside the scope of the ExecuteWithAdvices<TResult, TAction>(ObjectAccessLevel, TAction) method.

See Also