Class SourceListEditConvenienceEx
- Namespace
- Dynamic
Data
- Assembly
- DynamicData.dll
Convenience methods for a source list.
- Inheritance
-
Source
List Edit Convenience Ex
Methods
AddRange<T>(ISourceList<T>, IEnumerable<T>)
Adds the specified items to the source list.
Parameters
sourceISourceList <T>The source.
itemsIEnumerable<T>The items.
Type Parameters
TThe item type.
Add<T>(ISourceList<T>, T)
Adds the specified item to the source list.
Parameters
sourceISourceList <T>The source list.
itemTThe item to add.
Type Parameters
TThe item type.
Clear<T>(ISourceList<T>)
Clears all items from the specified source list.
Parameters
sourceISourceList <T>The source to clear.
Type Parameters
TThe item type.
EditDiff<T>(ISourceList<T>, IEnumerable<T>, IEqualityComparer<T>?)
Loads the list with the specified items in an optimised manner i.e. calculates the differences between the old and new items in the list and amends only the differences.
public static void EditDiff<T>(this ISourceList<T> source, IEnumerable<T> allItems, IEqualityComparer<T>? equalityComparer = null) where T : notnull
Parameters
sourceISourceList <T>The source.
allItemsIEnumerable<T>The items to compare against and performing a delta.
equalityComparerIEqualityComparer <T>The equality comparer used to determine whether an item has changed.
Type Parameters
TThe type of the object.
InsertRange<T>(ISourceList<T>, IEnumerable<T>, int)
Inserts the elements of a collection into the IExtendedList<T> at the specified index.
public static void InsertRange<T>(this ISourceList<T> source, IEnumerable<T> items, int index) where T : notnull
Parameters
sourceISourceList <T>The source.
itemsIEnumerable<T>The items.
indexintThe zero-based index at which the new elements should be inserted.
Type Parameters
TThe item type.
Insert<T>(ISourceList<T>, int, T)
Adds the specified item to the source list.
Parameters
sourceISourceList <T>The source.
indexintThe index of the item.
itemTThe item.
Type Parameters
TThe item type.
Move<T>(ISourceList<T>, int, int)
Moves an item from the original to the destination index.
public static void Move<T>(this ISourceList<T> source, int original, int destination) where T : notnull
Parameters
sourceISourceList <T>The source.
originalintThe original.
destinationintThe destination.
Type Parameters
TThe item type.
RemoveAt<T>(ISourceList<T>, int)
Removes the element at the specified index.
Parameters
sourceISourceList <T>The source.
indexintThe index.
Type Parameters
TThe item type.
RemoveMany<T>(ISourceList<T>, IEnumerable<T>)
Removes the items from source in an optimised manner.
public static void RemoveMany<T>(this ISourceList<T> source, IEnumerable<T> itemsToRemove) where T : notnull
Parameters
sourceISourceList <T>The source.
itemsToRemoveIEnumerable<T>The items to remove.
Type Parameters
TThe item type.
RemoveRange<T>(ISourceList<T>, int, int)
Removes a range of elements from the ISourceList<T>.
public static void RemoveRange<T>(this ISourceList<T> source, int index, int count) where T : notnull
Parameters
sourceISourceList <T>The source.
indexintThe zero-based starting index of the range of elements to remove.
countintThe number of elements to remove.
Type Parameters
TThe item type.
Exceptions
- Argument
Out OfRange Exception indexis less than 0.-or-countis less than 0.- Argument
Exception indexandcountdo not denote a valid range of elements in the List<T>.
Remove<T>(ISourceList<T>, T)
Removes the specified item from the source list.
Parameters
sourceISourceList <T>The source.
itemTThe item.
Returns
- bool
If the item was removed.
Type Parameters
TThe item type.
ReplaceAt<T>(ISourceList<T>, int, T)
Replaces the item at the specified index with the new item.
Parameters
sourceISourceList <T>The source.
indexintThe index.
itemTThe item.
Type Parameters
TThe item type.
Replace<T>(ISourceList<T>, T, T)
Replaces the specified original with the destination object.
public static void Replace<T>(this ISourceList<T> source, T original, T destination) where T : notnull
Parameters
sourceISourceList <T>The source.
originalTThe original.
destinationTThe destination.
Type Parameters
TThe item type.