protected override void ModifyObservableCollection(MultiTestObservableCollection <CollectionViewGalleryTestItem> observableCollection, params int[] indexes) { if (indexes.Length < 3) { return; } var startIndex = indexes[0]; var endIndex = indexes[1]; var destinationIndex = indexes[2]; var count = observableCollection.Count; // -1 < startIndex < endIndex < count if (startIndex < 0 || endIndex >= count || endIndex <= startIndex) { return; } var itemsToMove = endIndex - startIndex; // Can't move the items past the end of the list if (destinationIndex > (count - itemsToMove)) { return; } observableCollection.TestMoveWithList(startIndex, (endIndex - startIndex) + 1, destinationIndex); }
protected override void ModifyObservableCollection(MultiTestObservableCollection <CollectionViewGalleryTestItem> observableCollection, params int[] indexes) { if (indexes.Length < 2) { return; } var index1 = indexes[0]; var index2 = indexes[1]; if (index1 > -1 && index2 < observableCollection.Count && index1 <= index2) { if (_withIndex) { observableCollection.TestRemoveWithListAndIndex(index1, (index2 - index1) + 1); } else { observableCollection.TestRemoveWithList(index1, (index2 - index1) + 1); } } }
protected abstract void ModifyObservableCollection(MultiTestObservableCollection <CollectionViewGalleryTestItem> observableCollection, params int[] indexes);
protected override void ModifyObservableCollection(MultiTestObservableCollection <CollectionViewGalleryTestItem> observableCollection, params int[] indexes) { observableCollection.TestReset(); }