Example #1
0
        public SheetRangeGroup Select(Func <int, bool> indexSelector)
        {
            IEnumerable <SheetRange> select()
            {
                for (int index = Range.Start.row; index <= Range.End.row; index++)
                {
                    if (indexSelector(index))
                    {
                        yield return(new SheetRange(Range.Sheet, (Range.Start.row + index, Range.Start.col), (Range.Start.row + index, Range.End.col)));
                    }
                }
            }

            return(new SheetRangeGroup(select()));
        }
Example #2
0
        public SheetRange this[int?startOffset, int?endOffset]
        {
            get
            {
                if (startOffset is null)
                {
                    startOffset = 0;
                }
                if (endOffset is null)
                {
                    endOffset = Range.RowLength - 1;
                }

                return(new SheetRange(Range.Sheet, (Range.Start.row + startOffset.Value, Range.Start.col), (Range.Start.row + endOffset.Value, Range.End.col)));
            }
        }
Example #3
0
        public SheetRange this[int?startOffset, int?endOffset]
        {
            get
            {
                if (startOffset is null)
                {
                    startOffset = 0;
                }
                if (endOffset is null)
                {
                    endOffset = Range.ColumnLengh - 1;
                }

                return(new SheetRange(Range.Sheet, (Range.Start.row, Range.Start.col + startOffset.Value), (Range.End.row, Range.Start.col + endOffset.Value)));
            }
        }
Example #4
0
 public SheetRangeRowSelector(SheetRange range)
 {
     Range = range;
 }
Example #5
0
 public SheetRangeColumnSelector(SheetRange range)
 {
     Range = range;
 }