/// <summary> /// Called after the move operation has been completed. /// </summary> /// <param name="oldIndex">The old index.</param> /// <param name="newIndex">The new index.</param> /// <param name="value">The value.</param> protected override void OnMoveCompleted(int oldIndex, int newIndex, T value) { base.OnMoveCompleted(oldIndex, newIndex, value); this.EnsureNotDisposed(); if (!this.IsCachingSuspended && this.IsTracking) { var descriptor = new ItemMovedDescriptor <T>(value, newIndex, oldIndex); var change = new ItemMovedCollectionChange <T>(this, descriptor, itemMovedRejectCallback, null, string.Empty); this.Memento.Add(change, AddChangeBehavior.Default); } }
public void itemMovedDescriptor_ctor_normal_should_set_expected_values() { var item = new GenericParameterHelper(); var newIndex = 50; var oldIndex = 2; var target = new ItemMovedDescriptor<GenericParameterHelper>( item, newIndex, oldIndex ); target.Index.Should().Be.EqualTo( newIndex ); target.Item.Should().Be.EqualTo( item ); target.NewIndex.Should().Be.EqualTo( newIndex ); target.OldIndex.Should().Be.EqualTo( oldIndex ); }
public void itemMovedDescriptor_ctor_normal_should_set_expected_values() { var item = new GenericParameterHelper(); var newIndex = 50; var oldIndex = 2; var target = new ItemMovedDescriptor <GenericParameterHelper>(item, newIndex, oldIndex); target.Index.Should().Be.EqualTo(newIndex); target.Item.Should().Be.EqualTo(item); target.NewIndex.Should().Be.EqualTo(newIndex); target.OldIndex.Should().Be.EqualTo(oldIndex); }