本文整理汇总了C#中Fluqi.Extension.Helpers.jStringBuilder类的典型用法代码示例。如果您正苦于以下问题:C# jStringBuilder类的具体用法?C# jStringBuilder怎么用?C# jStringBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jStringBuilder类属于Fluqi.Extension.Helpers命名空间,在下文中一共展示了jStringBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetTagHtml
/// <summary>
/// Renders the panel header and returns the HTML
/// </summary>
/// <returns></returns>
internal string GetTagHtml() {
Accordion ac = this.OnPanel.OnAccordion;
bool prettyRender = ac.Rendering.PrettyRender;
bool renderCss = ac.Rendering.RenderCSS;
int tabDepth = ac.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth + 1);
// H3 tag (or whatever if it's been overridden in the options)
sb.AppendLineIf();
sb.AppendTabsFormatIf("<{0}", ac.Options.HeadingTag);
if (renderCss) {
base.WithCss("ui-accordion-header ui-helper-reset ui-state-default");
if (this.OnPanel.IsActive)
base.WithCss("ui-state-active ui-corner-top");
else
base.WithCss("ui-corner-all");
}
// add in any attributes the user has added
base.RenderAttributes(sb);
// and close off the starting H3 tag
sb.Append(">");
sb.Append(this.OnPanel.Title);
// Closing heading (H3)
sb.AppendFormatLineIf("</{0}>", ac.Options.HeadingTag);
return sb.ToString();
}
开发者ID:akhuang,项目名称:Fluqi,代码行数:37,代码来源:Header.cs
示例2: GetControlScript
/// <summary>
/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
/// a defined.
/// </summary>
/// <param name="tabDepth">
/// How far to indent the tabs in the script code.
/// </param>
/// <returns>
/// Returns rendered initialisation script
/// </returns>
public string GetControlScript(int tabDepth) {
jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
Core.ScriptOptions options = new Core.ScriptOptions();
this.Options.DiscoverOptions(options);
options.Render(sb);
return sb.ToString();
}
开发者ID:aspringer,项目名称:Fluqi,代码行数:19,代码来源:Animation.cs
示例3: GetStartUpScript
/// <summary>
/// Writes out the document.ready, text/JavaScript and tabs initialisation script
/// to the Response.
/// </summary>
/// <param name="incDocReady">
/// If true wraps the initialisation script with a jQuery document.ready section
/// If false only the control initialisation script is written.
/// </param>
/// <remarks>
/// Useful if you want more control over where the initialisation takes place.
/// </remarks>
public string GetStartUpScript(bool incDocReady) {
bool prettyRender = this.Rendering.PrettyRender;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
if (incDocReady)
sb.AppendUIStartUp(this.GetControlScript(tabDepth));
else
sb.AppendLineIf(this.GetControlScript(tabDepth));
return sb.ToString();
}
开发者ID:xuanvu,项目名称:Fluqi,代码行数:23,代码来源:Scripting.cs
示例4: CSharpCode
public string CSharpCode(ToolTip tip) {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);
sb.AppendTabsLineIf("<%");
sb.AppendTabsLineIf("Html.CreateToolTip(\"name\")");
string optionsCode = OptionsCSharpCode();
string positionOptionsCode = PositionsCSharpCode();
string showEventsCode = ShowEventsCSharpCode();
string renderCode = base.RenderCSharpCode();
bool showOptions = (optionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0);
if (showOptions) {
sb.IncIndent();
if (optionsCode.Length > 0 || positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Options");
sb.IncIndent();
sb.Append(optionsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Options");
sb.IncIndent();
sb.Append(optionsCode);
if (positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Position");
sb.Append(positionOptionsCode);
sb.AppendTabsLineIf(".Finish()");
}
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (showEventsCode.Length > 0) {
sb.AppendTabsLineIf(".Events");
sb.IncIndent();
sb.Append(showEventsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (renderCode.Length > 0)
sb.Append(renderCode);
sb.DecIndent();
}
sb.AppendTabsLineIf(".Render();");
sb.AppendTabsLineIf("%>");
return sb.ToString();
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:51,代码来源:ToolTipModel.cs
示例5: GetTagHtml
/// <summary>
/// Renders the HTML for the hyperlink.
/// </summary>
/// <returns>String of HTML</returns>
public string GetTagHtml() {
Accordion ac = this._Header.OnPanel.OnAccordion;
bool prettyRender = ac.Rendering.PrettyRender;
bool renderCss = ac.Rendering.RenderCSS;
int tabDepth = ac.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
sb.AppendTabsFormatIf("<a href=\"{0}\">", this.URL);
base.RenderAttributes(sb);
sb.Append(this.Title);
sb.Append("</a>");
return sb.ToString();
}
开发者ID:codeinpeace,项目名称:Fluqi,代码行数:18,代码来源:Hyperlink.cs
示例6: RenderCSharpCode
protected string RenderCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 1);
if (this.renderCSS || !this.prettyRender) {
// only add if we're using the non-default settings
sb.AppendTabsLineIf(".Rendering");
sb.IncIndent();
if (!this.prettyRender)
sb.AppendTabsLineIf(".Compress()");
if (this.renderCSS)
sb.AppendTabsLineIf(".ShowCSS()");
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
return sb.ToString();
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:17,代码来源:_BaseModel.cs
示例7: CSharpCode
public string CSharpCode(PushButton btn) {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);
sb.AppendTabsLineIf("<%");
sb.AppendTabsFormatLineIf("Html.CreateButton(\"{0}\", \"{1}\")", btn.ID, this.label);
string optionsCode = OptionsCSharpCode();
string showEventsCode = ShowEventsCSharpCode();
string renderCode = base.RenderCSharpCode();
bool showOptions = (optionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0);
if (showOptions) {
sb.IncIndent();
if (optionsCode.Length > 0) {
sb.AppendTabsLineIf(".Options");
sb.IncIndent();
sb.Append(optionsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (showEventsCode.Length > 0) {
sb.AppendTabsLineIf(".Events");
sb.IncIndent();
sb.Append(showEventsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (renderCode.Length > 0)
sb.Append(renderCode);
sb.DecIndent();
}
sb.AppendTabsLineIf(".Render();");
sb.AppendTabsLineIf("%>");
return sb.ToString();
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:38,代码来源:PushButtonModel.cs
示例8: RenderOpenItem
private void RenderOpenItem(jStringBuilder sb) {
bool renderCss = this.SelectMenu.Rendering.RenderCSS;
sb.AppendTabsFormat("<{0}", this.Tag);
this.RenderAttributes(sb);
if (this.Selected) {
sb.Append(" selected=\"selected\"");
}
if (!string.IsNullOrEmpty(this.Value)) {
sb.AppendFormat(" value=\"{0}\"", this.Value);
}
sb.Append(">");
sb.Append(this.Title);
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:18,代码来源:SelectMenuItem.cs
示例9: ShowEventsCSharpCode
protected string ShowEventsCSharpCode() {
if (!this.showEvents)
// nothing to see here
return "";
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
sb.AppendTabsLineIf(".SetCreateEvent(\"return createEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetChangeEvent(\"return changeEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetChangeStartEvent(\"return changeStartEvent(event, ui);\")");
return sb.ToString();
}
开发者ID:xuanvu,项目名称:Fluqi,代码行数:12,代码来源:AccordionModel.cs
示例10: GetTagHtml
/// <summary>
/// Builds up the HTML for the AutoComplete control and options (and returns the generated HTML).
/// </summary>
/// <returns>Generated HTML for the control.</returns>
protected internal string GetTagHtml() {
// ID property is _mandatory_
if (string.IsNullOrEmpty(this.ID))
throw new ArgumentException("AutoComplete ID property _must_ be supplied.");
bool prettyRender = this.Rendering.PrettyRender;
bool renderCss = this.Rendering.RenderCSS;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
if (renderCss)
this.WithCss("ui-autocomplete-input");
// turn off autocomplete, so it doesn't compete with dropdown menu
this.WithAttribute("autocomplete", "off");
sb.AppendTabsIf();
sb.AppendFormat("<input id=\"{0}\"", this.ID);
this.RenderAttributes(sb);
sb.Append(" />");
return sb.ToString();
}
开发者ID:xuanvu,项目名称:Fluqi,代码行数:26,代码来源:AutoComplete.cs
示例11: ToString
/// <summary>
/// Renders the JavaScript required to set the options with
/// the settings that are configured for this widget.
/// </summary>
/// <returns>
/// Returns the JavaScript to initialise the jQuery UI widget, given the configured options.
/// </returns>
public override string ToString() {
Core.ScriptOptions scripting = new Core.ScriptOptions();
this.DiscoverOptions(scripting);
jStringBuilder sb = new jStringBuilder(false/*includeWhitespace*/, 0/*tabDepth*/);
scripting.Render(sb);
return sb.ToString();
}
开发者ID:xuanvu,项目名称:Fluqi,代码行数:16,代码来源:Options.cs
示例12: ShowEventsCSharpCode
protected string ShowEventsCSharpCode() {
if (!this.showEvents)
// nothing to see here
return "";
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
sb.AppendTabsLineIf(".SetCreateEvent(\"createEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetSearchEvent(\"searchEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetResponseEvent(\"responseEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetOpenEvent(\"openEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetFocusEvent(\"focusEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetSelectEvent(\"selectEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetCloseEvent(\"closeEvent(event, ui);\")");
sb.AppendTabsLineIf(".SetChangeEvent(\"changeEvent(event, ui);\")");
return sb.ToString();
}
开发者ID:aspringer,项目名称:Fluqi,代码行数:18,代码来源:AutoCompleteModel.cs
示例13: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!Utils.IsNullEmptyOrDefault(this.appendTo, Options.DEFAULT_APPEND_TO))
sb.AppendTabsFormatLineIf(".SetAppendTo(\"{0}\")", this.appendTo);
if (this.autoFocus)
sb.AppendTabsLineIf(".SetAutoFocus(true)");
if (this.delay != Options.DEFAULT_DELAY)
sb.AppendTabsFormatLineIf(".SetDelay({0})", this.delay);
if (this.minLength != Options.DEFAULT_MINIMUM_LENGTH)
sb.AppendTabsFormatLineIf(".SetMinimumLength({0})", this.minLength);
return sb.ToString();
}
开发者ID:aspringer,项目名称:Fluqi,代码行数:16,代码来源:AutoCompleteModel.cs
示例14: RenderAsTable
/// <summary>
/// Returns an HTML table of all available icons, split into <paramref name="numColumns"/>.
/// </summary>
/// <param name="numColumns">Number of columns to split the table into</param>
/// <returns>HTML table of [rendered] icons</returns>
public static string RenderAsTable(int numColumns) {
int currCol = 0;
jStringBuilder sb = new jStringBuilder(true, 1);
sb.AppendTabsLine("<table id=\"table-icons\">");
List<string>.Enumerator e = Icons.ToList().GetEnumerator();
while (e.MoveNext()) {
if (currCol == 0)
sb.Append("<tr>");
sb.AppendTabs();
sb.AppendFormat("<td title=\".{0}\">", e.Current);
sb.AppendFormat( "<span class=\"ui-icon {0}\"></span>", e.Current);
sb.AppendFormat("</td>");
currCol++;
if (currCol == numColumns) {
sb.AppendLine("</tr>");
currCol = 0;
}
}
sb.AppendTabsLine("</table>");
return sb.ToString();
}
开发者ID:akhuang,项目名称:Fluqi,代码行数:29,代码来源:Icons.cs
示例15: GetTagHtml
/// <summary>
/// Builds and returns the HTML for the Spinner control (basically the DIV).
/// JavaScript initialisation for the control is also added to the response stream if the
/// AutoScript rendering option is true.
/// </summary>
/// <returns>HTML for the Spinner control.</returns>
protected internal string GetTagHtml() {
// ID property is _mandatory_
if (string.IsNullOrEmpty(this.ID))
throw new ArgumentException("Spinner ID property _must_ be supplied.");
bool prettyRender = this.Rendering.PrettyRender;
bool renderCss = this.Rendering.RenderCSS;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
this.WithID(this.ID);
if (renderCss) {
this.WithCss("ui-spinner-input");
}
sb.AppendTabsIf();
if (renderCss) {
sb.Append("<span class=\"ui-spinner ui-widget ui-widget-content ui-corner-all\"");
}
sb.Append("<input");
base.RenderAttributes(sb);
sb.AppendLineIf(">");
if (renderCss) {
// close the containing span
sb.Append("</span>");
}
// Note we don't render the Up/Down CSS even if RenderCSS is "true" as basically it doesn't make any
// sense to render them as they won't do anything without the JavaScript to intercept the behaviour
if (this.Rendering.AutoScript) {
this.RenderStartUpScript();
}
return sb.ToString();
} // GetTagHtml
开发者ID:akhuang,项目名称:Fluqi,代码行数:43,代码来源:Spinner.cs
示例16: RenderRootCloseItem
private void RenderRootCloseItem(jStringBuilder sb) {
sb.AppendTabsFormat("</{0}>", PARENT_TAG);
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:3,代码来源:SelectMenuItem.cs
示例17: RenderRootOpenItem
} // BuildTagHtml
private void RenderRootOpenItem(jStringBuilder sb) {
sb.AppendTabsFormat("<{0}", PARENT_TAG);
this.SelectMenu.RenderAttributes(sb);
sb.AppendLineIf(">");
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:7,代码来源:SelectMenuItem.cs
示例18: RenderAsList
/// <summary>
/// Returns an HTML list (ul/li set) of all the available icons.
/// </summary>
/// <returns>HTML list (ul/li set) of all the available icons.</returns>
public static string RenderAsList() {
jStringBuilder sb = new jStringBuilder(true, 1);
sb.AppendTabsLine("<ul id=\"icons\">");
List<string>.Enumerator e = Icons.ToList().GetEnumerator();
while (e.MoveNext()) {
sb.AppendTabs();
sb.AppendFormat("<li title=\".{0}\">", e.Current);
sb.AppendFormat( "<span class=\"ui-icon {0}\"></span>", e.Current);
sb.AppendFormat("</li>");
sb.AppendLine();
}
sb.AppendTabsLine("</ul>");
return sb.ToString();
}
开发者ID:akhuang,项目名称:Fluqi,代码行数:18,代码来源:Icons.cs
示例19: RenderCloseItem
private void RenderCloseItem(jStringBuilder sb) {
sb.AppendFormat("</{0}>", this.Tag);
}
开发者ID:toepoke,项目名称:Fluqi,代码行数:3,代码来源:SelectMenuItem.cs
示例20: CSharpCode
public string CSharpCode(AutoComplete ac) {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);
sb.AppendTabsLineIf("<%");
sb.AppendTabsFormatLineIf("Html.CreateAutoComplete(\"{0}\", {1})", ac.ID, this.GetSource());
string optionsCode = OptionsCSharpCode();
string positionOptionsCode = PositionsCSharpCode();
string showEventsCode = ShowEventsCSharpCode();
string renderCode = base.RenderCSharpCode();
bool showOptions = (optionsCode.Length > 0 || positionOptionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0);
if (showOptions) {
sb.IncIndent();
if (optionsCode.Length > 0 || positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Options");
sb.IncIndent();
sb.Append(optionsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Options");
sb.IncIndent();
sb.Append(optionsCode);
if (positionOptionsCode.Length > 0) {
sb.AppendTabsLineIf(".Position");
sb.Append(positionOptionsCode);
sb.AppendTabsLineIf(".Finish()");
}
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (showEventsCode.Length > 0) {
sb.AppendTabsLineIf(".Events");
sb.IncIndent();
sb.Append(showEventsCode);
sb.DecIndent();
sb.AppendTabsLineIf(".Finish()");
}
if (renderCode.Length > 0)
sb.Append(renderCode);
sb.DecIndent();
}
sb.AppendTabsLineIf(".Render();");
sb.AppendTabsLineIf("%>");
return sb.ToString();
}
开发者ID:aspringer,项目名称:Fluqi,代码行数:52,代码来源:AutoCompleteModel.cs
注:本文中的Fluqi.Extension.Helpers.jStringBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论