Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="column"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        public void Read(int column, int start, int end)
        {
            string columnName = ColumnConverter.Get(column);

            if (this.storedValues.ContainsKey(columnName))
            {
                this.storedValues.Remove(columnName);
            }
            if (this.worksheet != null)
            {
                Dictionary <int, string> tempDictionary = new Dictionary <int, string>();
                for (int i = start; i <= end; i++)
                {
                    Range  range     = this.worksheet.Cells[i, column] as Range;
                    string cellValue = range.Value != null?range.Value.ToString() : "null";

                    tempDictionary.Add(i, cellValue);
                }
                this.storedValues.Add(columnName, tempDictionary);
            }
            else
            {
                this.logger.Error($"The current worksheet seems to be null. Unable to read \"{this.excelPath}\".");
            }
        }
Exemple #2
0
 public Cell(int cellColumn, int rowIndex)
 {
     this.cellColumn = new Column(ColumnConverter.Get(cellColumn));
     this.cellRow    = new Row(rowIndex);
 }