Click or drag to resize

ListExtensionsGetPossibleStepsToMoveTowardsHigherIndicesT Method

Return the number of steps that selected items can be moved towards higher indices. The selected item with the highest index determines that value.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static int GetPossibleStepsToMoveTowardsHigherIndices<T>(
	this IReadOnlyList<T> list,
	Func<int, bool> IsSelected
)

Parameters

list  IReadOnlyListT
List to operate onto.
IsSelected  FuncInt32, Boolean
Function that determines for each item index if it is selected or not.

Type Parameters

T
Type of list item.

Return Value

Int32
The number of steps that all selected items can be moved towards higher indices, so that the selected item with the highest index is moved to the end of the list (at index list.Count-1).

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyListT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also