public XLTableRow LastRow(Func<IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
                return new XLTableRow(this, (_range.LastRow()));

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = rowCount; ro >= 1; ro--)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));
                if (predicate(row)) return row;

                row.Dispose();
            }
            return null;
        }
Exemple #2
0
        public XLTableRow FirstRowUsed(Boolean includeFormats, Func<IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
                return new XLTableRow(this, (_range.FirstRowUsed(includeFormats)));

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));

                if (!row.IsEmpty(includeFormats) && predicate(row))
                    return row;
                row.Dispose();
            }

            return null;
        }
Exemple #3
0
        public XLTableRow LastRow(Func <IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
            {
                return(new XLTableRow(this, (_range.LastRow())));
            }

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = rowCount; ro >= 1; ro--)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));
                if (predicate(row))
                {
                    return(row);
                }
            }
            return(null);
        }
Exemple #4
0
        public XLTableRow FirstRowUsed(Boolean includeFormats, Func <IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
            {
                return(new XLTableRow(this, (_range.FirstRowUsed(includeFormats))));
            }

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));

                if (!row.IsEmpty(includeFormats) && predicate(row))
                {
                    return(row);
                }
            }

            return(null);
        }
        internal XLTableRow FirstRowUsed(XLCellsUsedOptions options, Func <IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
            {
                return(new XLTableRow(this, (_range.FirstRowUsed(options))));
            }

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));

                if (!row.IsEmpty(options) && predicate(row))
                {
                    return(row);
                }
            }

            return(null);
        }
Exemple #6
0
        public XLTableRow FirstRow(Func <IXLTableRow, Boolean> predicate = null)
        {
            if (predicate == null)
            {
                return(new XLTableRow(this, (_range.FirstRow())));
            }

            Int32 rowCount = _range.RowCount();

            for (Int32 ro = 1; ro <= rowCount; ro++)
            {
                var row = new XLTableRow(this, (_range.Row(ro)));
                if (predicate(row))
                {
                    return(row);
                }

                row.Dispose();
            }

            return(null);
        }