当前位置: 首页>>代码示例>>C#>>正文


C# jStringBuilder.ToString方法代码示例

本文整理汇总了C#中Fluqi.Extension.Helpers.jStringBuilder.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# jStringBuilder.ToString方法的具体用法?C# jStringBuilder.ToString怎么用?C# jStringBuilder.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fluqi.Extension.Helpers.jStringBuilder的用法示例。


在下文中一共展示了jStringBuilder.ToString方法的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();
		}
开发者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: 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

示例5: 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:codeinpeace,项目名称:Fluqi,代码行数:17,代码来源:_BaseModel.cs

示例6: 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

示例7: 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

示例8: PositionsCSharpCode

		protected string PositionsCSharpCode() {
			jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 3);

			if (!string.IsNullOrEmpty(this.At1) && !string.IsNullOrEmpty(this.At2)) {
				sb.AppendTabsFormatLineIf(".SetAt(\"{0}\", \"{1}\")", this.At1, this.At2);
			} else if (!string.IsNullOrEmpty(this.At1)) {
				sb.AppendTabsFormatLineIf(".SetAt(\"{0}\")", this.At1);
			} else if (!string.IsNullOrEmpty(this.At2)) {
				sb.AppendTabsFormatLineIf(".SetAt(\"{0}\")", this.At2);
			}

			if (!string.IsNullOrEmpty(this.My1) && !string.IsNullOrEmpty(this.My2)) {
				sb.AppendTabsFormatLineIf(".SetMy(\"{0}\", \"{1}\")", this.My1, this.My2);
			} else if (!string.IsNullOrEmpty(this.My1)) {
				sb.AppendTabsFormatLineIf(".SetMy(\"{0}\")", this.My1);
			} else if (!string.IsNullOrEmpty(this.My2)) {
				sb.AppendTabsFormatLineIf(".SetMy(\"{0}\")", this.My2);
			}

			if (!Utils.IsNullEmptyOrDefault(this.Collision1, "none") && !Utils.IsNullEmptyOrDefault(this.Collision2, "none")) {
				sb.AppendTabsFormatLineIf(".SetCollision(\"{0}\", \"{1}\")", this.Collision1, this.Collision2);
			} else if (!Utils.IsNullEmptyOrDefault(this.Collision1, "none")) {
				sb.AppendTabsFormatLineIf(".SetCollision(\"{0}\")", this.Collision1);
			} else if (!Utils.IsNullEmptyOrDefault(this.Collision2, "none")) {
				sb.AppendTabsFormatLineIf(".SetCollision(\"{0}\")", this.Collision2);
			}

			return sb.ToString();
		}
开发者ID:aspringer,项目名称:Fluqi,代码行数:29,代码来源:AutoCompleteModel.cs

示例9: 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

示例10: 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

示例11: 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();
		}
开发者ID:toepoke,项目名称:Fluqi,代码行数:11,代码来源:MenuModel.cs

示例12: 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

示例13: 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();
		}
开发者ID:toepoke,项目名称:Fluqi,代码行数:14,代码来源:PushButtonModel.cs

示例14: 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();
		}
开发者ID:akhuang,项目名称:Fluqi,代码行数:18,代码来源:SpinnerModel.cs

示例15: 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();
		}
开发者ID:xuanvu,项目名称:Fluqi,代码行数:36,代码来源:AccordionModel.cs


注:本文中的Fluqi.Extension.Helpers.jStringBuilder.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。