private string FormatText(object text, ExportableAddtionalTextAttribute additionalText) { if (additionalText == null || string.IsNullOrEmpty(additionalText.Description)) { return(text.ToString()); } return(additionalText.Direction == Model.AdditionalTextEnum.LEFT ? additionalText.Description + text.ToString() : text.ToString() + additionalText.Description); }
public void AddColumnContentText(object text, string[] style, ExportableAddtionalTextAttribute additionalText) { StringBuilder styles = new StringBuilder(); Array.ForEach(style, s => styles.Append(s.Contains(";") ? s : s + ";")); table.Append(string.Format(" <td scope='row' style='{0}'>\n", styles)); table.Append(FormatText(text, additionalText)); table.Append(" </td>\n"); }