/// <summary> /// Appends the visual style to this paragraph. /// </summary> /// <param name="cell">The cell.</param> /// <param name="style">The style.</param> /// <returns> /// A <see cref="T:Novacode.Paragraph" /> with the style. /// </returns> public static Paragraph AppendVisualStyle(this Cell cell, StyleModel style) { SentinelHelper.ArgumentNull(cell); SentinelHelper.ArgumentNull(style); var paragraph = cell.AppendCommonVisualStyle(style); paragraph.Color(style.Font.GetColor()); return(paragraph); }
/// <summary> /// Appends the negative visual style to this paragraph. /// </summary> /// <param name="cell">The cell.</param> /// <param name="style">The style.</param> /// <returns> /// A <see cref="Novacode.Paragraph" /> with the style. /// </returns> public static Paragraph AppendNegativeVisualStyle(this Cell cell, StyleModel style) { SentinelHelper.ArgumentNull(cell); SentinelHelper.ArgumentNull(style); var color = Color.Transparent; var paragraph = cell.AppendCommonVisualStyle(style); var dataType = style.Content.DataType.Type; switch (dataType) { case KnownDataType.Numeric: case KnownDataType.Currency: var numericType = (NumericDataTypeModel)style.Content.DataType; color = numericType.Negative.GetColor(); break; } paragraph.Color(color); return(paragraph); }