Beispiel #1
0
        public IXLRangeRows Rows(string rows)
        {
            var retVal      = new XLRangeRows();
            var columnPairs = rows.Split(',');

            foreach (string trimmedPair in columnPairs.Select(pair => pair.Trim()))
            {
                string firstColumn;
                string lastColumn;
                if (trimmedPair.Contains(':') || trimmedPair.Contains('-'))
                {
                    var columnRange = trimmedPair.Contains('-')
                                          ? trimmedPair.Replace('-', ':').Split(':')
                                          : trimmedPair.Split(':');
                    firstColumn = columnRange[0];
                    lastColumn  = columnRange[1];
                }
                else
                {
                    firstColumn = trimmedPair;
                    lastColumn  = trimmedPair;
                }

                retVal.Add(Range(firstColumn, lastColumn).FirstRow());
            }

            return(retVal);
        }
Beispiel #2
0
        public IXLRangeRows Rows(String rows)
        {
            var retVal   = new XLRangeRows();
            var rowPairs = rows.Split(',');

            foreach (string tPair in rowPairs.Select(pair => pair.Trim()))
            {
                String firstRow;
                String lastRow;
                if (tPair.Contains(':') || tPair.Contains('-'))
                {
                    string[] rowRange = XLHelper.SplitRange(tPair);

                    firstRow = rowRange[0];
                    lastRow  = rowRange[1];
                }
                else
                {
                    firstRow = tPair;
                    lastRow  = tPair;
                }
                foreach (IXLRangeRow row in Rows(Int32.Parse(firstRow), Int32.Parse(lastRow)))
                {
                    retVal.Add(row);
                }
            }
            return(retVal);
        }
Beispiel #3
0
        public IXLRangeRows Rows(Int32 firstRow, Int32 lastRow)
        {
            var retVal = new XLRangeRows();

            for (int ro = firstRow; ro <= lastRow; ro++)
            {
                retVal.Add(Row(ro));
            }
            return(retVal);
        }
Beispiel #4
0
        public IXLRangeRows Rows(String rows)
        {
            var retVal   = new XLRangeRows();
            var rowPairs = rows.Split(',');

            foreach (string pair in rowPairs)
            {
                using (var asRange = AsRange())
                    asRange.Rows(pair.Trim()).ForEach(retVal.Add);
            }
            return(retVal);
        }
Beispiel #5
0
        public IXLRangeRows Rows(Func <IXLRangeRow, Boolean> predicate = null)
        {
            var   retVal   = new XLRangeRows();
            Int32 rowCount = RowCount();

            for (Int32 r = 1; r <= rowCount; r++)
            {
                var row = Row(r);
                if (predicate == null || predicate(row))
                {
                    retVal.Add(Row(r));
                }
            }
            return(retVal);
        }
Beispiel #6
0
        public XLRangeRows RowsUsed(Boolean includeFormats, Func <IXLRangeRow, Boolean> predicate = null)
        {
            XLRangeRows rows     = new XLRangeRows();
            Int32       rowCount = RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = Row(ro);

                if (!row.IsEmpty(includeFormats) && (predicate == null || predicate(row)))
                {
                    rows.Add(row);
                }
            }
            return(rows);
        }
        internal XLRangeRows RowsUsed(XLCellsUsedOptions options, Func <IXLRangeRow, Boolean> predicate = null)
        {
            XLRangeRows rows     = new XLRangeRows();
            Int32       rowCount = RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = Row(ro);

                if (!row.IsEmpty(options) && (predicate == null || predicate(row)))
                {
                    rows.Add(row);
                }
            }
            return(rows);
        }
Beispiel #8
0
 public IXLRangeRows Rows(String rows)
 {
     var retVal = new XLRangeRows();
     var rowPairs = rows.Split(',');
     foreach (string pair in rowPairs)
         using (var asRange = AsRange())
             asRange.Rows(pair.Trim()).ForEach(retVal.Add);
     return retVal;
 }
Beispiel #9
0
        public XLRangeRows RowsUsed(Boolean includeFormats, Func<IXLRangeRow, Boolean> predicate = null)
        {
            XLRangeRows rows = new XLRangeRows();
            Int32 rowCount = RowCount();
            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = Row(ro);

                if (!row.IsEmpty(includeFormats) && (predicate == null || predicate(row)))
                    rows.Add(row);
                else
                    row.Dispose();
            }
            return rows;
        }
Beispiel #10
0
        public IXLRangeRows Rows(String rows)
        {
            var retVal = new XLRangeRows();
            var rowPairs = rows.Split(',');
            foreach (string tPair in rowPairs.Select(pair => pair.Trim()))
            {
                String firstRow;
                String lastRow;
                if (tPair.Contains(':') || tPair.Contains('-'))
                {
                    string[] rowRange = XLHelper.SplitRange(tPair);

                    firstRow = rowRange[0];
                    lastRow = rowRange[1];
                }
                else
                {
                    firstRow = tPair;
                    lastRow = tPair;
                }
                foreach (IXLRangeRow row in Rows(Int32.Parse(firstRow), Int32.Parse(lastRow)))
                    retVal.Add(row);
            }
            return retVal;
        }
Beispiel #11
0
        public IXLRangeRows Rows(Int32 firstRow, Int32 lastRow)
        {
            var retVal = new XLRangeRows();

            for (int ro = firstRow; ro <= lastRow; ro++)
                retVal.Add(Row(ro));
            return retVal;
        }
Beispiel #12
0
 public IXLRangeRows Rows(Func<IXLRangeRow, Boolean> predicate = null)
 {
     var retVal = new XLRangeRows();
     Int32 rowCount = RowCount();
     for (Int32 r = 1; r <= rowCount; r++)
     {
         var row = Row(r);
         if (predicate == null || predicate(row))
             retVal.Add(Row(r));
         else
             row.Dispose();
     }
     return retVal;
 }
Beispiel #13
0
        public IXLRangeRows Rows(string rows)
        {
            var retVal = new XLRangeRows();
            var columnPairs = rows.Split(',');
            foreach (string trimmedPair in columnPairs.Select(pair => pair.Trim()))
            {
                string firstColumn;
                string lastColumn;
                if (trimmedPair.Contains(':') || trimmedPair.Contains('-'))
                {
                    var columnRange = trimmedPair.Contains('-')
                                          ? trimmedPair.Replace('-', ':').Split(':')
                                          : trimmedPair.Split(':');
                    firstColumn = columnRange[0];
                    lastColumn = columnRange[1];
                }
                else
                {
                    firstColumn = trimmedPair;
                    lastColumn = trimmedPair;
                }

                retVal.Add(Range(firstColumn, lastColumn).FirstRow());
            }

            return retVal;
        }