コード例 #1
0
        public void RemoveRange_End()
        {
            var range = new MultiRange {
                10, 11, 12, 13, 14
            };

            range.Remove(new Range(13, 15));

            Assert.Equal(3, range.Count);
            Assert.Equal(new[] { R(10, 13) }, range.GetRanges());
        }
コード例 #2
0
        public void RemoveRange_Super()
        {
            var range = new MultiRange {
                10, 11, 12, 13, 14
            };

            range.Remove(new Range(8, 16));

            Assert.Equal(0, range.Count);
            Assert.Equal(new Range[0], range.GetRanges());
        }
コード例 #3
0
        public void RemoveRange_Mid()
        {
            var range = new MultiRange {
                10, 11, 12, 13, 14
            };

            range.Remove(new Range(11, 14));

            Assert.Equal(2, range.Count);
            Assert.Equal(new[] { R(10), R(14) }, range.GetRanges());
        }
コード例 #4
0
        public void Remove_End()
        {
            var range = new MultiRange {
                10, 11, 12
            };

            range.Remove(12);

            Assert.Equal(2, range.Count);
            Assert.Equal(new[] { R(10, 12) }, range.GetRanges());
        }
コード例 #5
0
        public void Remove_Mid()
        {
            var range = new MultiRange {
                10, 11, 12, 13, 14
            };

            range.Remove(12);

            Assert.Equal(4, range.Count);
            Assert.Equal(new[] { R(10, 12), R(13, 15) }, range.GetRanges());
        }
コード例 #6
0
        public void Remove_NotContained()
        {
            var range = new MultiRange {
                10, 11, 12
            };

            range.Remove(42);

            Assert.Equal(3, range.Count);
            Assert.Equal(new[] { R(10, 13) }, range.GetRanges());
        }
コード例 #7
0
        public void RemoveRange_Multiple(int begin, int end)
        {
            var range = new MultiRange {
                10, 11, 13, 14, 16, 17
            };
            var expected = new MultiRange(range);

            for (int i = begin; i < end; ++i)
            {
                expected.Remove(i);
            }

            range.Remove(new Range(begin, end));

            Assert.Equal(expected.Count, range.Count);
            Assert.Equal(expected.GetRanges(), range.GetRanges());
        }
コード例 #8
0
 private void UnselectIdx(int rowIndex)
 {
     selectedIndices.Remove(rowIndex);
 }