本文整理汇总了C#中Fluqi.Extension.Helpers.jStringBuilder.TrimEnd方法的典型用法代码示例。如果您正苦于以下问题:C# jStringBuilder.TrimEnd方法的具体用法?C# jStringBuilder.TrimEnd怎么用?C# jStringBuilder.TrimEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fluqi.Extension.Helpers.jStringBuilder
的用法示例。
在下文中一共展示了jStringBuilder.TrimEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderAttributes
/// <summary>
/// Renders the registered attributes to the provided jStringBuilder object. The registered
/// CSS classes and Style rules are also added at this point (as they're attributes as well really).
/// </summary>
protected internal void RenderAttributes(jStringBuilder sb) {
bool hasID = _HtmlAttr.Keys.Any(x => x == "id");
// force the ID to come out first (as this is what you're interested in 90% of the time)
if (hasID) {
sb.AppendFormat(" id=\"{0}\"", HttpUtility.HtmlAttributeEncode(_HtmlAttr["id"].ToString()) );
}
// add in any defined CSS classes
if (_CssClasses.Any()) {
sb.Append(" class=\"");
sb.Append(this._CssClasses.ToSeparated(" ") );
sb.Append("\"");
}
// add in the full style rules
if (_Styles.Any()) {
sb.Append(" style=\"");
foreach (string key in this._Styles.Keys) {
sb.AppendFormat("{0}:{1};", HttpUtility.HtmlAttributeEncode(key), HttpUtility.HtmlAttributeEncode(_Styles[key].ToString()) );
}
sb.TrimEnd(";");
sb.Append("\"");
}
if (_HtmlAttr.Any()) {
// avoid ID as this will already have been added
foreach (string key in _HtmlAttr.Keys.Where(x => x != "id")) {
sb.AppendFormat(" {0}=\"{1}\"", key, HttpUtility.HtmlAttributeEncode(_HtmlAttr[key].ToString()) );
}
}
}