コード例 #1
0
ファイル: Scripting.cs プロジェクト: xuanvu/Fluqi
		/// <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();
		}