private void removeRow(RemoveRowCollectionChange removeRow) { var indexToBeRemoved = mapSectionIndexToAdapterIndex(removeRow.Index); var sectionCountBefore = sectionsIndexes.Count; updateSectionIndexes(); if (sectionCountBefore == sectionsIndexes.Count) { NotifyItemRemoved(indexToBeRemoved); NotifyItemChanged(sectionsIndexes[removeRow.Index.Section] + HeaderOffset); } else { NotifyItemRangeRemoved(indexToBeRemoved - 1, 2); } }
public void SendsEventWhenItemRemoved() { List <int> list = new List <int> { 40, 70, 8, 3, 1, 2 }; var collection = new ObservableGroupedOrderedCollection <int>(i => i, i => i, i => i.ToString().Length); collection.ReplaceWith(list); var scheduler = new TestScheduler(); var observer = scheduler.CreateObserver <ICollectionChange>(); collection.CollectionChange.Subscribe(observer); collection.RemoveItemAt(0, 2); ICollectionChange change = new RemoveRowCollectionChange(new SectionedIndex(0, 2)); observer.Messages.AssertEqual( OnNext(0, change) ); }
private bool remove(RemoveRowCollectionChange change) { return(remove(change.Index)); }
private int remove(RemoveRowCollectionChange change) { remove(change.Index); return(change.Index.Section); }