本文整理汇总了C#中Fluqi.Extension.Helpers.jStringBuilder.AppendTabsFormatLineIf方法的典型用法代码示例。如果您正苦于以下问题:C# jStringBuilder.AppendTabsFormatLineIf方法的具体用法?C# jStringBuilder.AppendTabsFormatLineIf怎么用?C# jStringBuilder.AppendTabsFormatLineIf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fluqi.Extension.Helpers.jStringBuilder
的用法示例。
在下文中一共展示了jStringBuilder.AppendTabsFormatLineIf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CSharpCode
public string CSharpCode(ProgressBar pb) {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);
sb.AppendTabsLineIf("<%");
sb.AppendTabsFormatLineIf("Html.CreateProgressBar(\"{0}\")", pb.ID );
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();
}
示例2: 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.AppendLineIf(">");
// now add in the hyperlink that lives inside the H3
sb.IncIndent();
sb.AppendTabsLineIf(this.Hyperlink.GetTagHtml());
sb.DecIndent();
// Closing heading (H3)
sb.AppendTabsFormatLineIf("</{0}>", ac.Options.HeadingTag);
return sb.ToString();
}
示例3: RenderRootCloseItem
private void RenderRootCloseItem(jStringBuilder sb) {
sb.AppendTabsFormatLineIf("</{0}>", PARENT_TAG);
}
示例4: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!this.text)
sb.AppendTabsLineIf(".SetText(false)");
// icons must be set as a pair
if (!string.IsNullOrEmpty(this.primaryIcon) || !string.IsNullOrEmpty(this.secondaryIcon)) {
sb.AppendTabsFormatLineIf(".SetIcons(\"{0}\", \"{1}\")", this.primaryIcon, this.secondaryIcon);
}
return sb.ToString();
}
示例5: 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();
}
示例6: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!string.IsNullOrEmpty(this.downIconClass) && !string.IsNullOrEmpty(this.upIconClass))
sb.AppendTabsFormatLineIf(".SetIcons(\"{0}\", \"{1}\")", this.downIconClass, this.upIconClass);
if (!string.IsNullOrEmpty(this.min))
sb.AppendTabsFormatLineIf(".SetMin({0})", this.min);
if (!string.IsNullOrEmpty(this.max))
sb.AppendTabsFormatLineIf(".SetMax({0})", this.max);
if (!string.IsNullOrEmpty(this.step))
sb.AppendTabsFormatLineIf(".SetStep({0})", this.step);
if (this.page != Options.DEFAULT_PAGE)
sb.AppendTabsFormatLineIf(".SetPage({0})", this.page);
return sb.ToString();
}
示例7: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!string.IsNullOrEmpty(this.animated)) {
if (Helpers.Utils.IsBool(this.animated))
sb.AppendTabsFormatLineIf(".SetAnimated({0})", bool.Parse(this.animated).JsBool());
else if (!Helpers.Utils.IsNullEmptyOrDefault(this.animated, Widget.jAccordion.Options.DEFAULT_ANIMATED))
sb.AppendTabsFormatLineIf(".SetAnimated(\"{0}\")", this.animated);
}
if (!this.autoHeight)
sb.AppendTabsLineIf(".SetAutoHeight(false)");
if (this.clearStyle)
sb.AppendTabsLineIf(".SetClearStyle(true)");
if (this.collapsible)
sb.AppendTabsLineIf(".SetCollapsible(true)");
if (!Helpers.Utils.IsNullEmptyOrDefault(this.evt, Widget.jAccordion.Options.DEFAULT_EVENT))
sb.AppendTabsFormatLineIf(".SetEvent(\"{0}\")", this.evt);
if (this.fillSpace)
sb.AppendTabsLineIf(".SetFillSpace(true)");
// icons have to be set as a pair
bool addNormalIcon = !string.IsNullOrEmpty(this.headerIconClass) && this.headerIconClass != Widget.jAccordion.Options.DEFAULT_HEADER_ICON_CLASS;
bool addSelectedIcon = !string.IsNullOrEmpty(this.headerSelectedIconClass) && this.headerSelectedIconClass != Widget.jAccordion.Options.DEFAULT_HEADER_SELECTED_ICON_CLASS;
if (addNormalIcon || addSelectedIcon) {
sb.AppendTabsFormatLineIf(".SetIcons(\"{0}\", \"{1}\")", this.headerIconClass, this.headerSelectedIconClass);
}
if (this.navigation)
sb.AppendTabsLineIf(".SetNavigation(true)");
if (!string.IsNullOrEmpty(this.navigationFilter))
sb.AppendTabsFormatLineIf(".SetNavigationFilter({0})", this.navigationFilter);
return sb.ToString();
}
示例8: 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();
}
示例9: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.Disabled) sb.AppendTabsLineIf(".SetDisabled(true)");
if (Helpers.Utils.IsBool(this.Animated)) {
if (bool.Parse(this.Animated))
sb.AppendTabsLineIf(".SetAnimate(true)");
} else if (Helpers.Utils.IsNumeric(this.Animated)) {
sb.AppendTabsFormatLineIf(".SetAnimate({0})", this.Animated);
}
if (this.Min != Options.DEFAULT_MIN)
sb.AppendTabsFormatLineIf(".SetMin({0})", this.Min);
if (this.Max != Options.DEFAULT_MAX)
sb.AppendTabsFormatLineIf(".SetMax({0})", this.Max);
if (Core.Orientation.StringToOrientation(this.Orientation) != Options.DEFAULT_ORIENTATION)
sb.AppendTabsFormatLineIf(".SetOrientation(\"{0}\")", this.Orientation);
if (Helpers.Utils.IsBool(this.Range)) {
if (bool.Parse(this.Range))
sb.AppendTabsLineIf(".SetRange(true)");
} else {
sb.AppendTabsFormatLineIf(".SetRange(\"{0}\")", this.Range);
}
if (this.Step != Options.DEFAULT_STEP)
sb.AppendTabsFormatLineIf(".SetStep({0})", this.Step);
if (this.Value != Options.DEFAULT_VALUE)
sb.AppendTabsFormatLineIf(".SetValue({0})", this.Value);
if (!string.IsNullOrEmpty(this.Values))
sb.AppendTabsFormatLineIf(".SetValues({0})", this.Values);
sb.AppendTabsFormatLineIf(".SetSize(\"{0}\")", this.Size);
return sb.ToString();
}
示例10: RenderChildren
/// <summary>
/// Renders the list of SelectMenuItems to the string builder.
/// Note: For the SelectMenu this only happens for the root (i.e. this isn't recursive like the Menu control)
/// </summary>
/// <param name="sb">StringBuilder</param>
protected internal void RenderChildren(jStringBuilder sb) {
// Open list/item
if (!_IsRoot)
sb.AppendTabsFormat("<{0}>", CHILD_TAG);
foreach (SelectMenuItemBase mi in this.Children._SelectMenuItems) {
mi.BuildTagHtml(sb);
}
// Close list/item
if (!_IsRoot)
sb.AppendTabsFormatLineIf("</{0}>", CHILD_TAG);
}
示例11: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (this.value != Options.DEFAULT_VALUE)
sb.AppendTabsFormatLineIf(".SetValue({0})", this.value);
return sb.ToString();
}
示例12: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.Disabled) sb.AppendTabsLineIf(".SetDisabled(true)");
if (Core.Icons.StringToIcon(this.Icons) != Core.Icons.eIconClass.carat_1_e) {
sb.AppendTabsFormatLineIf(".SetIcons(\"{0}\")", this.Icons);
}
return sb.ToString();
}
示例13: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.Disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!string.IsNullOrEmpty(this.AltField))
sb.AppendTabsFormatLineIf(".SetAltField(\"{0}\")", this.AltField);
if (!string.IsNullOrEmpty(this.AltFormat))
sb.AppendTabsFormatLineIf(".SetAltFormat(\"{0}\")", this.AltFormat);
if (!string.IsNullOrEmpty(this.AppendText))
sb.AppendTabsFormatLineIf(".SetAppendText(\"{0}\")", this.AppendText);
if (this.AutoSize)
sb.AppendTabsLineIf(".SetAutoSize(true)");
if (!string.IsNullOrEmpty(this.ButtonImage))
sb.AppendTabsFormatLineIf(".SetButtonImage(\"{0}\")", this.ButtonImage);
if (this.ButtonImageOnly)
sb.AppendTabsLineIf(".SetButtonImageOnly(true)");
if (!Utils.IsNullEmptyOrDefault(this.ButtonText, Options.DEFAULT_BUTTON_TEXT))
sb.AppendTabsFormatLineIf(".SetButtonText(\"{0}\")", this.ButtonText);
if (!Utils.IsNullEmptyOrDefault(this.CalculateWeek, Options.DEFAULT_CALCULATE_WEEK) )
sb.AppendTabsFormatLineIf(".SetCalculateWeek(\"{0}\")", this.CalculateWeek);
if (this.ChangeMonth)
sb.AppendTabsLineIf(".SetChangeMonth(true)");
if (this.ChangeYear)
sb.AppendTabsLineIf(".SetChangeYear(true)");
if (!Utils.IsNullEmptyOrDefault(this.CloseText, Options.DEFAULT_CLOSE_TEXT))
sb.AppendTabsFormatLineIf(".SetCloseText(\"{0}\")", this.CloseText);
if (!this.ConstrainInput)
sb.AppendTabsLineIf(".SetConstraintInput(false)");
if (!Utils.IsNullEmptyOrDefault(this.CurrentText, Options.DEFAULT_CURRENT_TEXT))
sb.AppendTabsFormatLineIf(".SetCurrentText(\"{0}\")", this.CurrentText);
if (!Utils.IsNullEmptyOrDefault(this.DateFormat, Options.DEFAULT_DATE_FORMAT))
sb.AppendTabsFormatLineIf(".SetDateFormat({0})", Utils.AddQuotesToJQueryDate(this.DateFormat));
if (!Utils.IsNullEmptyOrDefault(this.Duration, Options.DEFAULT_DURATION))
sb.AppendTabsFormatLineIf(".SetDuration(\"{0}\")", this.Duration);
if (this.FirstDay != Options.DEFAULT_FIRST_DAY)
sb.AppendTabsFormatLineIf(".SetFirstDay({0})", this.FirstDay);
if (this.GotoCurrent)
sb.AppendTabsLineIf(".SetGotoCurrent(true)");
if (this.HideIfNoPrevNext)
sb.AppendTabsLineIf(".SetHideIfNoPrevNext(true)");
if (this.IsRTL)
sb.AppendTabsLineIf(".SetIsRTL(true)");
if (!string.IsNullOrEmpty(this.MinDate))
sb.AppendTabsFormatLineIf(".SetMinDate({0})", Utils.AddQuotesToJQueryDate(this.MinDate));
if (!string.IsNullOrEmpty(this.MaxDate))
sb.AppendTabsFormatLineIf(".SetMaxDate({0})", Utils.AddQuotesToJQueryDate(this.MaxDate));
if (this.NavigationAsDateFormat)
sb.AppendTabsLineIf(".SetNavigationAsDateFormat(true)");
if (!Utils.IsNullEmptyOrDefault(this.NextText, Options.DEFAULT_NEXT_TEXT))
sb.AppendTabsFormatLineIf(".SetNextText(\"{0}\")", this.NextText);
if (!Utils.IsNullEmptyOrDefault(this.PrevText, Options.DEFAULT_PREV_TEXT))
sb.AppendTabsFormatLineIf(".SetPrevText(\"{0}\")", this.PrevText);
if (this.NumberOfMonths != Options.DEFAULT_NUMBER_OF_MONTHS) {
sb.AppendTabsFormatLineIf(".SetNumberOfMonths({0})", this.NumberOfMonths);
}
if (this.SelectOtherMonths)
sb.AppendTabsLineIf(".SetSelectOtherMonths(true)");
if (!Utils.IsNullEmptyOrDefault(this.ShortYearCutoff, Options.DEFAULT_SHORT_YEAR_CUTOFF))
sb.AppendTabsFormatLineIf(".SetShortYearCutoff(\"{0}\")", this.ShortYearCutoff);
if (!Utils.IsNullEmptyOrDefault(this.ShowAnim, Options.DEFAULT_SHOW_ANIM))
sb.AppendTabsFormatLineIf(".SetShowAnim(\"{0}\")", this.ShowAnim);
if (this.ShowButtonPanel)
sb.AppendTabsLineIf(".SetShowButtonPanel(true)");
if (this.ShowCurrentAtPos != Options.DEFAULT_SHOW_CURRENT_AT_POS)
sb.AppendTabsFormatLineIf(".SetShowCurrentAtPos({0})", this.ShowCurrentAtPos);
if (this.ShowMonthAfterYear)
sb.AppendTabsFormatLine(".SetShowMonthAfterYear(true)");
if (!Utils.IsNullEmptyOrDefault(this.ShowOn, Options.DEFAULT_SHOW_ON))
sb.AppendTabsFormatLineIf(".SetShowOn(\"{0}\")", this.ShowOn);
if (this.ShowOtherMonths)
sb.AppendTabsFormatLineIf(".SetShowOtherMonths({0})", this.ShowOtherMonths);
if (this.ShowWeek)
sb.AppendTabsLineIf(".SetShowWeek(true)");
if (this.StepMonths != Options.DEFAULT_STEP_MONTHS)
sb.AppendTabsFormatLineIf(".SetStepMonths({0})", this.StepMonths);
if (!Utils.IsNullEmptyOrDefault(this.WeekHeader, Options.DEFAULT_WEEK_HEADER))
sb.AppendTabsFormatLineIf(".SetWeekHeader(\"{0}\")", this.WeekHeader);
if (!Utils.IsNullEmptyOrDefault(this.YearRange, Options.DEFAULT_YEAR_RANGE))
sb.AppendTabsFormatLineIf(".SetYearRange(\"{0}\")", this.YearRange);
if (!string.IsNullOrEmpty(this.YearSuffix))
sb.AppendTabsFormatLineIf(".SetYearSuffix(\"{0}\")", this.YearSuffix);
if (this.FakeDayNamesChange) {
if (!Utils.IsNullEmptyOrDefault(this.DayNames, Options.DEFAULT_DAY_NAMES))
sb.AppendTabsFormatLineIf(".SetDayNames(\"{0}\")", this.DayNames.JsArray());
if (!Utils.IsNullEmptyOrDefault(this.DayNamesMin, Options.DEFAULT_DAY_NAMES_MIN))
sb.AppendTabsFormatLineIf(".SetDayNamesMin(\"{0}\")", this.DayNamesMin.JsArray());
if (!Utils.IsNullEmptyOrDefault(this.DayNamesShort, Options.DEFAULT_DAY_NAMES_SHORT))
sb.AppendTabsFormatLineIf(".SetDayNamesShort(\"{0}\")", this.DayNamesShort.JsArray());
}
if (this.FakeMonthNamesChange) {
if (!Utils.IsNullEmptyOrDefault(this.MonthNames, Options.DEFAULT_MONTH_NAMES))
sb.AppendTabsFormatLineIf(".SetMonthNames(\"{0}\")", this.MonthNames.JsArray());
if (!Utils.IsNullEmptyOrDefault(this.MonthNamesShort, Options.DEFAULT_MONTH_NAMES_SHORT))
sb.AppendTabsFormatLineIf(".SetMonthNamesShort(\"{0}\")", this.MonthNamesShort.JsArray());
}
return sb.ToString();
}
示例14: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (!string.IsNullOrEmpty(this.showEffect))
sb.AppendTabsFormatLineIf(".ShowAnimation.SetEffect(\"{0}\").Finish()", this.showEffect);
if (!string.IsNullOrEmpty(this.hideEffect))
sb.AppendTabsFormatLineIf(".HideAnimation.SetEffect(\"{0}\").Finish()", this.hideEffect);
if (this.track)
sb.AppendTabsFormatLineIf(".SetTrack({0})", this.track.JsBool());
return sb.ToString();
}
示例15: OptionsCSharpCode
protected string OptionsCSharpCode() {
jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);
if (this.disabled)
sb.AppendTabsLineIf(".SetDisabled(true)");
if (this.collapsible)
sb.AppendTabsLineIf(".SetCollapsible(true)");
if (!string.IsNullOrEmpty(this.fx))
sb.AppendTabsFormatLineIf(".SetEffect(\"{0}\")", this.fx);
if (!Utils.IsNullEmptyOrDefault(this.evt, Options.DEFAULT_EVENT))
sb.AppendTabsFormatLineIf(".SetEvent(\"{0}\")", this.evt);
return sb.ToString();
}