public string GetContent(CustomDetailContentStyle style) { string content = string.Empty; foreach (var detail in this.details) { if (style.Equals(CustomDetailContentStyle.BulletedList)) { content += "-"; } content += detail; switch (style) { case CustomDetailContentStyle.OnePerLine: case CustomDetailContentStyle.BulletedList: content += "\r\n"; break; case CustomDetailContentStyle.CommaSeparated: content += ", "; break; } } return(content); }
public CustomDetail(string fieldName, CustomDetailContentStyle style) { if (string.IsNullOrWhiteSpace(fieldName)) { throw new ArgumentNullException("fieldName"); } this.fieldName = fieldName; this.details = new List <string>(); this.style = style; }