public void RestoreSnapshot(MultiRange selectedRows) { lock (selectedIndices) { UnselectAll(); selectedIndices.UnionWith(selectedRows); RaiseSelectionChanged(); } }
public void UnionWith_Empty2() { var range1 = new MultiRange { 10, 11, 12 }; var range2 = new MultiRange(); range1.UnionWith(range2); Assert.Equal(3, range1.Count); Assert.Equal(0, range2.Count); Assert.Equal(new[] { R(10, 13) }, range1.GetRanges()); Assert.Empty(range2.GetRanges()); }
public void UnionWith_Overlapping() { var range1 = new MultiRange { 10, 11, 12 }; var range2 = new MultiRange { 11, 12, 13 }; range1.UnionWith(range2); Assert.Equal(4, range1.Count); Assert.Equal(3, range2.Count); Assert.Equal(new[] { R(10, 14) }, range1.GetRanges()); }
public void UnionWith_Adjacent() { var range1 = new MultiRange { 10, 11, 12 }; var range2 = new MultiRange { 13, 14, 15 }; range1.UnionWith(range2); Assert.Equal(6, range1.Count); Assert.Equal(3, range2.Count); Assert.Equal(new[] { R(10, 16) }, range1.GetRanges()); }
public void UnionWith_NonOverlapping() { var range1 = new MultiRange { 23, 24, 25 }; var range2 = new MultiRange { 10, 11, 12 }; range1.UnionWith(range2); Assert.Equal(6, range1.Count); Assert.Equal(3, range2.Count); Assert.Equal(new[] { R(10, 13), R(23, 26) }, range1.GetRanges()); }