/// <summary> /// Créé une nouvelle instance de ExcelCell. /// </summary> /// <param name="builder">Builder.</param> /// <param name="columnIndex">Index de la colonne.</param> /// <param name="rowIndex">Index de la ligne.</param> /// <param name="columnName">Nom de la colonne.</param> private ExcelCell(ExcelTemplateBuilder builder, uint columnIndex, uint rowIndex, string columnName) { _builder = builder; _columnIndex = columnIndex; _columnName = columnName; _rowIndex = rowIndex; _name = _columnName + _rowIndex; }
/// <summary> /// Créé une cellule Excel. /// </summary> /// <param name="builder">Builder.</param> /// <param name="reference">Nom de la cellule (A1, B2, ...).</param> /// <returns>Cellule Excel.</returns> public static ExcelCell Create(ExcelTemplateBuilder builder, string reference) { /* Découpe le nom de la cellule. */ var match = _referencePattern.Match(reference); var columnName = match.Groups[1].Value; var rowName = match.Groups[2].Value; /* Calcule les coordonnées. */ var rowIndex = uint.Parse(rowName); var columnIndex = IndexFromColumnName(columnName); return(new ExcelCell(builder, columnIndex, rowIndex, columnName)); }
/// <summary> /// Créé une cellule Excel. /// </summary> /// <param name="builder">Builder.</param> /// <param name="columnName">Nom de la colonne.</param> /// <param name="rowIndex">Index de la ligne.</param> /// <returns>Cellule Excel.</returns> public static ExcelCell Create(ExcelTemplateBuilder builder, string columnName, uint rowIndex) { var columnIndex = IndexFromColumnName(columnName); return(new ExcelCell(builder, columnIndex, rowIndex, columnName)); }