Ejemplo n.º 1
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;

                row.Dispose();
            }
            return null;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 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);
        }