using System.Xml.Serialization;

namespace ExcelZipLib
{
   public class Row
   {
      /// <summary>
      /// The filled cells.
      /// </summary>
      [XmlElement("c")]
      public Cell[] FilledCells;

      /// <summary>
      /// The cells.
      /// </summary>
      [XmlIgnore]
      public Cell[] Cells;

      /// <summary>
      /// Expands the cells.
      /// </summary>
      /// <param name="NumberOfColumns">The number of columns.</param>
      public void ExpandCells(int NumberOfColumns)
      {
         Cells = new Cell[NumberOfColumns];

         foreach (var cell in FilledCells)
         {
            Cells[cell.ColumnIndex] = cell;
         }

         FilledCells = null;
      }
   }
}