本文整理汇总了C#中Fluqi.Extension.Helpers.jStringBuilder.AppendLineIf方法的典型用法代码示例。如果您正苦于以下问题:C# jStringBuilder.AppendLineIf方法的具体用法?C# jStringBuilder.AppendLineIf怎么用?C# jStringBuilder.AppendLineIf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fluqi.Extension.Helpers.jStringBuilder
的用法示例。
在下文中一共展示了jStringBuilder.AppendLineIf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: 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();
}
示例3: RenderRootOpenItem
} // BuildTagHtml
private void RenderRootOpenItem(jStringBuilder sb) {
sb.AppendTabsFormat("<{0}", PARENT_TAG);
this.SelectMenu.RenderAttributes(sb);
sb.AppendLineIf(">");
}
示例4: Dispose
/// <summary>
/// Writes out the closing tag for the content DIV of the tab
/// </summary>
/// <param name="disposing"></param>
protected virtual void Dispose(bool disposing) {
if (!this._Disposed)
{
this._Disposed = true;
bool prettyRender = this.Panes.Tabs.Rendering.PrettyRender;
int tabDepth = this.Panes.Tabs.Rendering.TabDepth + 1;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
if (this.Visible) {
// Close pane
sb.AppendLineIf();
sb.AppendTabsLineIf("</div>");
_Writer.Write(sb.ToString());
}
}
}
示例5: RenderBody
} // RenderHeader
/// <summary>
/// Writes out the opening part of the content part of the jQuery UI tab (the DIV just after the LI header)
/// that belongs to this particular tab. So basically this marries up the LI and the content for the LI.
/// </summary>
/// <param name="sb"></param>
private void RenderBody(jStringBuilder sb) {
bool renderCss = this.Panes.Tabs.Rendering.RenderCSS;
bool prettyRender = this.Panes.Tabs.Rendering.PrettyRender;
this.WithID(this.IDOrLocation);
if (renderCss)
this.WithCss("ui-tabs-panel ui-widget-content ui-corner-bottom");
sb.IncIndent();
sb.AppendTabsIf("<div");
base.RenderAttributes(sb);
sb.AppendLineIf(">");
sb.DecIndent();
}
示例6: RenderRootOpenItem
} // BuildTagHtml
private void RenderRootOpenItem(jStringBuilder sb) {
sb.AppendTabsFormat("<{0}", this.Menu.Options.Menus);
this.Menu.RenderAttributes(sb);
sb.AppendLineIf(">");
}
示例7: Dispose
/// <summary>
/// Writes out the closing tag for the content DIV of the tab
/// </summary>
/// <param name="disposing"></param>
protected virtual void Dispose(bool disposing) {
if (this._Disposed)
return;
this._Disposed = true;
Accordion ac = this.OnAccordion;
bool prettyRender = ac.Rendering.PrettyRender;
int tabDepth = ac.Rendering.TabDepth + 1;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
// Close pane container div
sb.AppendLineIf();
sb.AppendTabsFormatLineIf("</{0}>", ac.Options.ContentTag);
_Writer.Write(sb.ToString());
} // Dispose
示例8: 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 script code setting.
/// </param>
/// <returns>
/// Returns rendered initialisation script
/// </returns>
protected internal string GetControlScript(int tabDepth) {
jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
sb.IncIndent();
sb.AppendTabsFormatIf("$(\"#{0}\").button(", this.ID);
Core.ScriptOptions options = new Core.ScriptOptions();
this.Options.DiscoverOptions(options);
this.Events.DiscoverOptions(options);
options.Render(sb);
sb.Append(");");
if (!string.IsNullOrEmpty(this.Events.ClickEvent)) {
// as ClickEvent isn't a "real" jQuery UI button event, it has to be wired up separately
sb.AppendLineIf();
sb.AppendTabsFormatLineIf("$(\"#{0}\").click(function() {{", this.ID);
sb.Append(this.Events.ClickEvent);
sb.AppendLineIf();
sb.AppendTabsLineIf("});");
}
sb.DecIndent();
return sb.ToString();
}
示例9: EndDialog
/// <summary>
/// Writes the closing part of the Dialog HTML to the response stream (basically the closing div).
/// </summary>
protected internal void EndDialog() {
bool prettyRender = this.Rendering.PrettyRender;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
// Closing dialog DIV
sb.AppendLineIf();
sb.AppendTabsLineIf("</div>");
Writer.Write(sb.ToString());
if (this.Rendering.AutoScript) {
this.RenderStartUpScript();
}
} // EndDialog
示例10: GetTagHtml
/// <summary>
/// Builds and returns the HTML required for the opening of the Tabs control.
/// </summary>
/// <returns>HTML for the opening of the tabs control.</returns>
protected internal string GetTagHtml() {
bool prettyRender = this.Rendering.PrettyRender;
bool renderCss = this.Rendering.RenderCSS;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
// Work out if we have an active tab set, if not default to the first one
if (!this.Panes.HasSelectedTab() && _Panes._Panes.Any())
_Panes._Panes.Values.FirstOrDefault().IsSelected = true;
if (renderCss) {
this.WithCss("ui-tabs ui-widget ui-widget-content ui-corner-all");
}
this.WithID(this.ID);
sb.Append("<div");
this.RenderAttributes(sb);
sb.AppendLineIf(">");
// Open Tabs header
sb.IncIndent();
if (renderCss)
sb.AppendTabsFormatLineIf("<ul class=\"ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\">");
else
sb.AppendTabsLineIf("<ul>");
// Have each tab render it's Header link
_HeaderRendered = true; // main header rendered
sb.IncIndent();
foreach (Pane tb in _Panes._Panes.Values) {
tb.RenderHeader(sb);
}
// Close Tabs header
sb.DecIndent();
sb.AppendTabsLineIf("</ul>");
// Finally prep for iterating over the tabs
this.Panes.ResetEnumerator();
return sb.ToString();
}
示例11: RenderBody
/// <summary>
/// Renders the body of the accordion panel.
/// </summary>
/// <param name="sb">StringBuilder to render the object to</param>
internal void RenderBody(jStringBuilder sb) {
bool renderCss = this.OnAccordion.Rendering.RenderCSS;
// Opening pane container div
sb.AppendTabsFormatIf("<{0}", this.OnAccordion.Options.ContentTag);
base.RenderAttributes(sb);
if (renderCss) {
sb.Append(" class=\"ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if (this.IsActive)
sb.Append(" ui-accordion-content-active");
sb.Append("\"");
}
sb.Append(">");
sb.AppendLineIf();
}
示例12: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.Disabled) sb.AppendTabsLineIf(".SetDisabled(true)");
if (!this.AutoOpen) sb.AppendTabsLineIf(".SetAutoOpen(false)");
if (!this.CloseOnEscape) sb.AppendTabsLineIf(".SetCloseOnEscape(false)");
if (!Utils.IsNullEmptyOrDefault(this.CloseText, Options.DEFAULT_CLOSE_TEXT)) sb.AppendTabsFormatLineIf(".SetCloseText(\"{0}\")", this.CloseText);
if (!string.IsNullOrEmpty(this.DialogClass)) sb.AppendTabsFormatLineIf(".SetDialogClass(\"{0}\")", this.DialogClass);
if (!this.Draggable) sb.AppendTabsLineIf(".SetDraggable(false)");
if (!Utils.IsNullEmptyOrDefault(this.Height, Options.DEFAULT_HEIGHT)) {
if (Utils.IsNumeric(this.Height))
sb.AppendTabsFormatLineIf(".SetHeight({0})", this.Height);
else
sb.AppendTabsFormatLineIf(".SetHeight(\"{0}\")", this.Height);
}
if (!string.IsNullOrEmpty(this.HideEffect)) sb.AppendTabsFormatLineIf(".SetHideEffect(\"{0}\")", this.HideEffect);
if (this.MinWidth != Options.DEFAULT_MIN_WIDTH) sb.AppendTabsFormatLineIf(".SetMinWidth({0})", this.MinWidth);
if (!Utils.IsNullEmptyOrDefault(this.MaxWidth, Options.DEFAULT_MAX_WIDTH)) {
if (Utils.IsNumeric(this.MaxWidth))
sb.AppendTabsFormatLineIf(".SetMaxWidth({0})", this.MaxWidth);
else
sb.AppendTabsFormatLineIf(".SetMaxWidth(\"{0}\")", this.MaxWidth);
}
if (this.MinHeight != Options.DEFAULT_MIN_HEIGHT) sb.AppendTabsFormatLineIf(".SetMinHeight({0})", this.MinHeight);
if (!Utils.IsNullEmptyOrDefault(this.MaxHeight, Options.DEFAULT_MAX_HEIGHT)) {
if (Utils.IsNumeric(this.MaxHeight))
sb.AppendTabsFormatLineIf(".SetMaxHeight({0})", this.MaxHeight);
else
sb.AppendTabsFormatLineIf(".SetMaxHeight(\"{0}\")", this.MaxHeight);
}
if (this.Modal) sb.AppendTabsFormatLineIf(".SetModal(true)");
if (!Utils.IsNullEmptyOrDefault(this.Position1, Options.DEFAULT_POSITION)) {
// first one is populated, so there's something of interest here
sb.AppendTabsIf(".SetPosition(");
if (Utils.IsNumeric(this.Position1))
sb.Append(this.Position1);
else
sb.AppendFormat("\"{0}\"", this.Position1);
if (!string.IsNullOrEmpty(this.Position2)) {
// second one is populated too
if (Utils.IsNumeric(this.Position2))
sb.AppendFormat(", {0}", this.Position2);
else
sb.AppendFormat(", \"{0}\"", this.Position2);
}
// and close
sb.AppendLineIf(")");
}
if (!this.Resizable) sb.AppendTabsFormatLineIf(".SetResizable(false)");
if (!string.IsNullOrEmpty(this.ShowEffect)) sb.AppendTabsFormatLineIf(".SetShowEffect(\"{0}\")", this.ShowEffect);
if (!this.Stack) sb.AppendTabsLineIf(".SetStack(true)");
if (!string.IsNullOrEmpty(this.Title)) sb.AppendTabsFormatLineIf(".SetTitle(\"{0}\")", this.Title);
if (this.Width != Options.DEFAULT_WIDTH) sb.AppendTabsFormatLineIf(".SetWidth({0})", this.Width);
if (this.ZIndex != Options.DEFAULT_ZINDEX) sb.AppendTabsFormatLineIf(".SetZIndex({0})", this.ZIndex);
// buttons are always added in the demo
sb.AppendTabsLineIf(".AddButton(\"OK\", \"return OKClicked();\")");
sb.AppendTabsLineIf(".AddButton(\"Cancel\", \"return CancelClicked();\")");
return sb.ToString();
}
示例13: CSharpCode
public string CSharpCode() {
Dialog dlg = BuildDialogFromModel(this.Writer, "js_dlg");
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);
sb.AppendTabsLineIf("<%");
sb.AppendTabsLineIf("Dialog dlg = Html.CreateDialog(\"dlg\")");
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(";");
sb.AppendTabsLineIf("%>");
sb.AppendLineIf();
sb.AppendTabsLineIf("<%using (dlg.RenderDialog()) {%>");
sb.AppendTabsLineIf("\t<p>Proin ...</p>");
sb.AppendTabsLineIf("<%}%>");
return sb.ToString();
}
示例14: EndAccordion
/// <summary>
/// Writes the closing part of the Tabs layout (i.e. the closing DIV tag).
/// Also writes out the document.ready and tabs initialisation JavaScript
/// </summary>
protected internal void EndAccordion() {
bool prettyRender = this.Rendering.PrettyRender;
int tabDepth = this.Rendering.TabDepth;
jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth);
// Closing Accordion DIV
sb.AppendLineIf();
sb.AppendTabsFormatLineIf("</{0}>", this.Options.ContainerTag);
this.Writer.Write(sb.ToString());
if (this.Rendering.AutoScript) {
this.RenderStartUpScript();
}
} // EndAccordion
示例15: GetTagHtml
/// <summary>
/// Builds and returns the HTML for the Slider 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 Slider control.</returns>
protected internal string GetTagHtml() {
// ID property is _mandatory_
if (string.IsNullOrEmpty(this.ID))
throw new ArgumentException("Slider 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-slider ui-widget ui-widget-content ui-corner-all");
this.WithCss("ui-slider-{0}", Core.Orientation.OrientationToString(this.Options.Orientation));
}
if (this.Options.Orientation == Core.Orientation.eOrientation.Horizontal) {
if (this.Options.Size != Options.DEFAULT_SIZE)
this.WithStyle("width", this.Options.Size);
} else {
// vertical always has to be output otherwise the slider won't work, so no default
// check here
this.WithStyle("height", this.Options.Size);
}
sb.AppendTabsIf();
sb.Append("<div");
base.RenderAttributes(sb);
sb.AppendLineIf("></div>");
if (this.Rendering.AutoScript) {
this.RenderStartUpScript();
}
return sb.ToString();
} // GetTagHtml