Exemplo n.º 1
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);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        private void AddToTables(XLRange range, Boolean addToTables)
        {
            if (!addToTables)
            {
                return;
            }

            _uniqueNames = new HashSet <string>();
            Int32 co = 1;

            foreach (IXLCell c in range.Row(1).Cells())
            {
                if (XLHelper.IsNullOrWhiteSpace(((XLCell)c).InnerText))
                {
                    c.Value = GetUniqueName("Column", co, true);
                }
                _uniqueNames.Add(c.GetString());
                co++;
            }
            Worksheet.Tables.Add(this);
        }
Exemplo n.º 3
0
        private void AddToTables(XLRange range, Boolean addToTables)
        {
            if (!addToTables) return;

            _uniqueNames = new HashSet<string>();
            Int32 co = 1;
            foreach (IXLCell c in range.Row(1).Cells())
            {
                if (XLHelper.IsNullOrWhiteSpace(((XLCell)c).InnerText))
                    c.Value = GetUniqueName("Column" + co.ToInvariantString());
                _uniqueNames.Add(c.GetString());
                co++;
            }
            Worksheet.Tables.Add(this);
        }