public static HtmlString HtmlForText(this WidgetFactory html, string text, string tag = "p") { if (!text.HasValue()) { text = " "; } else { if (!tag.HasValue()) { text = text.Replace("\n", ""); } else if (tag == "br") { text = text.Replace("\n", "<br/>"); } else { text = $"<{tag}>{text.Replace("\n", $"</{tag}><{tag}>")}</{tag}>"; } } return(new HtmlString(text)); }
public static HtmlString HtmlForAttach(this WidgetFactory ace, string attachs, string cls = "lh20") { if (!attachs.HasValue()) { return(new HtmlString(" ")); } var sb = new StringBuilder(); int index = 0; attachs.Trim(',').Split(',').Each(delegate(string item) { if (item.HasValue()) { string text = App.GetWebPath(item); string attachTitle = ace.GetAttachTitle(item); sb.Append("<div>"); sb.Append($"<a class=\"{cls}\" href=\"{text}\" target=\"_blank\" title=\"{attachTitle}\">{++index}.{attachTitle}</a>"); sb.Append("</div>"); } }); return(new HtmlString(sb.ToString())); }
public ContentWidgetBase(WidgetFactory ace) : base(ace) { Controls = new List <IHtmlContent>(); }
public static HtmlString HtmlForMobile(this WidgetFactory html, string mobile, string none = "未绑定") { mobile = (mobile.HasValue() ? (mobile.Left(3) + "****" + mobile.Right(4)) : none); return(new HtmlString(mobile)); }
public ListWidgetBase(WidgetFactory ace) : base(ace) { Items = new List <Item>(); }
public TreeWidgetBase(WidgetFactory ace) : base(ace) { Nodes = new List <Node>(); }
public void Initialize(WidgetFactory ace) { Ace = ace; Context = ace.Context; }
public WidgetBase(WidgetFactory ace) : this() { Initialize(ace); }
public TreeNodeWidgetBase(WidgetFactory ace, T tree) : base(ace) { base.Widget = null; Tree = tree; }