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); }
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); }
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); }