public static TagBuilder RenderNotice(this HtmlHelper helper, string key, NoticeDefinition definition) { return RenderNotice(key, definition); }
public static NoticeDefinition Notify(this IDictionary<string, object> data, string key) { var not = new NoticeDefinition(); data[DefaultNotificationFormat.AsFormat(key)] = not; return not; }
public static TagBuilder RenderNotice(string key, NoticeDefinition definition) { if (definition != null) { var notice = new TagBuilder("div").WithClasses(key); if (definition.Title != null) { var span = new TagBuilder("span").WithText(definition.Title); notice.InnerHtml += span.ToString(); } if (definition.Items != null && definition.Items.Count > 0) { var ul = new TagBuilder("ul").WithHtml( definition.Items.Aggregate(new StringBuilder(), (str, y) => str.Append(new TagBuilder("li").WithText(y))).ToString()); notice.InnerHtml += ul.ToString(); } return notice; } else return null; ; }