/// <summary>
 /// Writes a record to the Excel file.
 /// </summary>
 /// <param name="record">The record to write.</param>
 /// <exception cref="ObjectDisposedException">
 /// Thrown is the serializer has been disposed.
 /// </exception>
 public virtual void Write(string[] record)
 {
     CheckDisposed();
     for (var i = 0; i < record.Length; i++)
     {
         range.AsRange().Cell(currentRow + RowOffset, i + 1 + ColumnOffset).Value = ReplaceHexadecimalSymbols(record[i]);
     }
     currentRow++;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Reads a record from the Excel file.
        /// </summary>
        /// <returns>
        /// A <see cref="T:String[]" /> of fields for the record read.
        /// </returns>
        /// <exception cref="ObjectDisposedException">Thrown if the parser has been disposed.</exception>
        public virtual string[] Read()
        {
            CheckDisposed();
            var row = range.AsRange().Row(Row + RowOffset);

            if (row.CellsUsed().Any())
            {
                var result = row.Cells(1 + ColumnOffset, FieldCount + ColumnOffset)
                             .Select(cell => cell.Value.ToString())
                             .ToArray();
                Row++;
                return(result);
            }
            return(null);
        }
Ejemplo n.º 3
0
 public XLAutoFilter Set(IXLRangeBase range)
 {
     Range   = range.AsRange();
     Enabled = true;
     return(this);
 }
Ejemplo n.º 4
0
 public void Add(IXLRangeBase range)
 {
     Count++;
     _ranges.Add(range.AsRange() as XLRange);
 }
Ejemplo n.º 5
0
 public XLAutoFilter Set(IXLRangeBase range)
 {
     Range = range.AsRange();
     Enabled = true;
     return this;
 }
Ejemplo n.º 6
0
 public void Add(IXLRangeBase range)
 {
     Add(range.AsRange() as XLRange);
 }