Supports movement of selected items up/down in a list.
Static member | Description |
Full Usage:
ListExtensions.AddRange(collection, itemsToAdd)
Parameters:
ObservableCollection<'T>
itemsToAdd : IEnumerable<'T>
|
|
Full Usage:
ListExtensions.AddRange(destination, itemsToAdd)
Parameters:
ICollection<'T>
-
The collection where to add the items.
itemsToAdd : IEnumerable<'T>
-
The items to add.
|
Adds a range of items to a collection.
|
Full Usage:
ListExtensions.ExchangePositions(list, i, j)
Parameters:
IList<'T>
-
List to operate with.
i : int
-
Position of the first item.
j : int
-
Position of the second item.
|
Exchange the positions of two items in a list.
|
Full Usage:
ListExtensions.FillWith(collection, itemsToAdd)
Parameters:
ObservableCollection<'T>
itemsToAdd : IEnumerable<'T>
|
|
Full Usage:
ListExtensions.FillWith(collection, itemsToAdd)
Parameters:
ICollection<'T>
itemsToAdd : IEnumerable<'T>
|
|
Full Usage:
ListExtensions.GetPossibleStepsToMoveTowardsHigherIndices(list, IsSelected)
Parameters:
IReadOnlyList<'T>
-
List to operate onto.
IsSelected : Func<int, bool>
-
Function that determines for each item index if it is selected or not.
Returns: int
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).
|
Return the number of steps that selected items can be moved towards higher indices. The selected item with the highest index determines that value.
|
Full Usage:
ListExtensions.GetPossibleStepsToMoveTowardsLowerIndices(list, IsSelected)
Parameters:
IReadOnlyList<'T>
-
List to operate onto.
IsSelected : Func<int, bool>
-
Function that determines for each item index if it is selected or not.
Returns: int
The number of steps that all selected items can be moved towards lower indices, so that the selected item with the lowest index is moved to index 0.
|
Return the number of steps that selected items can be moved towards lower indices. The selected item with the lowest index determines that value.
|
Full Usage:
ListExtensions.IndexOf(list, searchedItem)
Parameters:
IEnumerable<'T>
-
The item list.
searchedItem : 'T
-
The searched item.
Returns: int
Index of the first occurence of the searched item in the list (0 for the first item). If the item is not found in the list, a negative value is returned.
|
Gets the index of an item in a enumeration or list.
|
Full Usage:
ListExtensions.IndexOfFirst(list, predicate)
Parameters:
IEnumerable<'T>
-
The list.
predicate : Func<'T, bool>
-
The predicate function. The first argument is the item. If the return value is true, the index of this item is returned.
Returns: int
Index the of first item in list that fulfills the predicate, or a value of -1 if no such item could be found.
|
Gets the index the of first item in list that fulfills the predicate predicate
|
Full Usage:
ListExtensions.IndexOfFirst(list, predicate)
Parameters:
IEnumerable<'T>
-
The list.
predicate : Func<'T, int, bool>
-
The predicate function. The first argument is the item, the second argument is the item's index in the enumeration. If the return value is true, the index of this item is returned.
Returns: int
Index the of first item in list that fulfills the predicate, or a value of -1 if no such item could be found.
|
Gets the index the of first item in list that fulfills the predicate predicate
|
Full Usage:
ListExtensions.IndexOfLast(list, predicate)
Parameters:
IList<'T>
-
The list.
predicate : Func<'T, int, bool>
-
The predicate function. The first argument is the item, the second argument is the item's index in the list. If the return value is true, the index of this item is returned.
Returns: int
Index the of last item in list that fulfills the predicate, or a value of -1 if no such an item could be found.
|
Gets the index the of last item in list that fulfills the predicate predicate
|
Full Usage:
ListExtensions.MoveItemToIndex(list, originalIndex, destinationIndex)
Parameters:
IList<'T>
-
List to operate with.
originalIndex : int
-
Original position of the item.
destinationIndex : int
-
Destination position of the item.
|
Moves a item to another list position. All items inbetween the interval originalIndex and destinationIndex will slip by one position (except the item at originalIndex, which will of course move to destinationIndex.
|
Full Usage:
ListExtensions.MoveSelectedItems(list, IsSelected, steps)
Parameters:
IList<'T>
-
List to operate with.
IsSelected : Func<int, bool>
-
Function that determines for each item index if it is selected or not.
steps : int
-
Number of steps to move. A positive value moves the items towards higher indices, a negative value towards lower indices.
|
Moves the selected items towards higher indices (for steps > 0) or lower indices (for steps < 0). |
Moves the selected item so that the selected item with the formerly highest index is afterwards at the end of the list (at index list.Count-1). |
|
Moves the selected item so that the selected item with the formerly lowest index is afterwards at the start of the list (at index 0). |
|
Full Usage:
ListExtensions.MoveSelectedItemsTowardsHigherIndices(list, isSelected, steps)
Parameters:
IList<'T>
-
List to operate with.
isSelected : Func<int, bool>
-
Function that determines for each item index if it is selected or not.
steps : int
-
Number of steps to move. Has to be a positive value.
|
Moves the selected items towards higher indices. |
Full Usage:
ListExtensions.MoveSelectedItemsTowardsLowerIndices(list, isSelected, steps)
Parameters:
IList<'T>
-
List to operate with.
isSelected : Func<int, bool>
-
Function that determines for each item index if it is selected or not.
steps : int
-
Number of steps to move. Has to be a positive value.
|
Moves the selected items towards lower indices. |
|
Removes all items for which the predicate function returns The list is iterated backwards, starting from the last item in the list, and ending with the first item in the list. |
|
Removes all items for which the predicate function returns The list is iterated backwards, starting from the last item in the list, and ending with the first item in the list. |