public IXLRangeColumns Columns(String columns) { var retVal = new XLRangeColumns(); var columnPairs = columns.Split(','); foreach (string tPair in columnPairs.Select(pair => pair.Trim())) { String firstColumn; String lastColumn; if (tPair.Contains(':') || tPair.Contains('-')) { string[] columnRange = XLHelper.SplitRange(tPair); firstColumn = columnRange[0]; lastColumn = columnRange[1]; } else { firstColumn = tPair; lastColumn = tPair; } Int32 tmp; if (Int32.TryParse(firstColumn, out tmp)) { foreach (IXLRangeColumn col in Columns(Int32.Parse(firstColumn), Int32.Parse(lastColumn))) retVal.Add(col); } else { foreach (IXLRangeColumn col in Columns(firstColumn, lastColumn)) retVal.Add(col); } } return retVal; }
public IXLRangeColumns Columns(string columns) { var retVal = new XLRangeColumns(); var rowPairs = columns.Split(','); foreach (string trimmedPair in rowPairs.Select(pair => pair.Trim())) { string firstRow; string lastRow; if (trimmedPair.Contains(':') || trimmedPair.Contains('-')) { var rowRange = trimmedPair.Contains('-') ? trimmedPair.Replace('-', ':').Split(':') : trimmedPair.Split(':'); firstRow = rowRange[0]; lastRow = rowRange[1]; } else { firstRow = trimmedPair; lastRow = trimmedPair; } retVal.Add(Range(firstRow, lastRow).FirstColumn()); } return(retVal); }
public virtual IXLRangeColumns Columns(Int32 firstColumn, Int32 lastColumn) { var retVal = new XLRangeColumns(); for (int co = firstColumn; co <= lastColumn; co++) retVal.Add(Column(co)); return retVal; }
public virtual IXLRangeColumns Columns(Int32 firstColumn, Int32 lastColumn) { var retVal = new XLRangeColumns(); for (int co = firstColumn; co <= lastColumn; co++) { retVal.Add(Column(co)); } return(retVal); }
public IXLRangeColumns Columns(String columns) { var retVal = new XLRangeColumns(); var columnPairs = columns.Split(','); foreach (string pair in columnPairs) { AsRange().Columns(pair.Trim()).ForEach(retVal.Add); } return(retVal); }
public IXLRangeColumns Columns(Func<IXLRangeColumn, Boolean> predicate = null) { var retVal = new XLRangeColumns(); Int32 columnCount = ColumnCount(); for (Int32 c = 1; c <= columnCount; c++) { var column = Column(c); if (predicate == null || predicate(column)) retVal.Add(column); else column.Dispose(); } return retVal; }
public virtual IXLRangeColumns Columns(Func <IXLRangeColumn, Boolean> predicate = null) { var retVal = new XLRangeColumns(); Int32 columnCount = ColumnCount(); for (Int32 c = 1; c <= columnCount; c++) { var column = Column(c); if (predicate == null || predicate(column)) { retVal.Add(column); } } return(retVal); }
public virtual XLRangeColumns ColumnsUsed(Boolean includeFormats, Func <IXLRangeColumn, Boolean> predicate = null) { XLRangeColumns columns = new XLRangeColumns(); Int32 columnCount = ColumnCount(); for (Int32 co = 1; co <= columnCount; co++) { var column = Column(co); if (!column.IsEmpty(includeFormats) && (predicate == null || predicate(column))) { columns.Add(column); } } return(columns); }
internal virtual XLRangeColumns ColumnsUsed(XLCellsUsedOptions options, Func <IXLRangeColumn, Boolean> predicate = null) { XLRangeColumns columns = new XLRangeColumns(); Int32 columnCount = ColumnCount(); for (Int32 co = 1; co <= columnCount; co++) { var column = Column(co); if (!column.IsEmpty(options) && (predicate == null || predicate(column))) { columns.Add(column); } } return(columns); }
public IXLRangeColumns Columns(String columns) { var retVal = new XLRangeColumns(); var columnPairs = columns.Split(','); foreach (string tPair in columnPairs.Select(pair => pair.Trim())) { String firstColumn; String lastColumn; if (tPair.Contains(':') || tPair.Contains('-')) { string[] columnRange = XLHelper.SplitRange(tPair); firstColumn = columnRange[0]; lastColumn = columnRange[1]; } else { firstColumn = tPair; lastColumn = tPair; } Int32 tmp; if (Int32.TryParse(firstColumn, out tmp)) { foreach (IXLRangeColumn col in Columns(Int32.Parse(firstColumn), Int32.Parse(lastColumn))) { retVal.Add(col); } } else { foreach (IXLRangeColumn col in Columns(firstColumn, lastColumn)) { retVal.Add(col); } } } return(retVal); }
public XLRangeColumns ColumnsUsed(Boolean includeFormats, Func<IXLRangeColumn, Boolean> predicate = null) { XLRangeColumns columns = new XLRangeColumns(); Int32 columnCount = ColumnCount(); for (Int32 co = 1; co <= columnCount; co++) { var column = Column(co); if (!column.IsEmpty(includeFormats) && (predicate == null || predicate(column))) columns.Add(column); else column.Dispose(); } return columns; }
public IXLRangeColumns Columns(string columns) { var retVal = new XLRangeColumns(); var rowPairs = columns.Split(','); foreach (string trimmedPair in rowPairs.Select(pair => pair.Trim())) { string firstRow; string lastRow; if (trimmedPair.Contains(':') || trimmedPair.Contains('-')) { var rowRange = trimmedPair.Contains('-') ? trimmedPair.Replace('-', ':').Split(':') : trimmedPair.Split(':'); firstRow = rowRange[0]; lastRow = rowRange[1]; } else { firstRow = trimmedPair; lastRow = trimmedPair; } retVal.Add(Range(firstRow, lastRow).FirstColumn()); } return retVal; }
public IXLRangeColumns Columns(String columns) { var retVal = new XLRangeColumns(); var columnPairs = columns.Split(','); foreach (string pair in columnPairs) using (var asRange = AsRange()) asRange.Columns(pair.Trim()).ForEach(retVal.Add); return retVal; }