Beispiel #1
0
#pragma warning restore 1591

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="pb">ProgressBar to configure options of</param>
		public Options(ProgressBar pb)
		 : base()
		{
			this.ProgressBar = pb;
			// initialise the Position object 
			// ... (we won't be calling the Render directly, so we're OK giving it no valid data)
			this.Reset();
		}
Beispiel #2
0
		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();	
		}
Beispiel #3
0
		public void ConfigureProgressBar(ProgressBar pb) {
			pb
				.Rendering
					.SetPrettyRender(true)
				.Finish()
				.Options
					.SetDisabled(this.disabled)
					.SetValue(this.value)
				.Finish()
			;

			if (this.showEvents) {
				pb.Events
					.SetCreateEvent("createEvent(event, ui);")
					.SetChangeEvent("changeEvent(event, ui);")
					.SetCompleteEvent("completeEvent(event, ui);")
				.Finish();
			}
			if (!this.prettyRender)
				pb.Rendering.Compress();
			if (this.renderCSS)
				pb.Rendering.ShowCSS();
		}
Beispiel #4
0
		internal static void ForceRender(ProgressBar pb)
		{
			pb.Render();
		}
Beispiel #5
0
		internal static ProgressBar SetupSimpleProgressBarObject(TextWriter writer) 
		{
			// nothing special, just create a simple dummy tab helper as a starting point 
			// (saves having the same code everywhere!)
			ProgressBar pb = new ProgressBar(writer, "pb");

			return pb;
		}
		/// <summary>
		/// Creates a ProgressBar control that can be configured and later rendered onto the page.
		/// </summary>
		/// <param name="page">WebForms page to render the control onto</param>
		/// <param name="id">ID to give to the accordion (must be unique on the page)</param>
		/// <returns>Created ProgressBar control</returns>
		public static ProgressBar CreateProgressBar(this System.Web.UI.Page page, string id) {
			TextWriter writer = page.Response.Output;
			ProgressBar pb = new ProgressBar(writer, id);

			return pb;
		}
		/// <summary>
		/// Creates a ProgressBar control that can be configured and later rendered onto the page.
		/// </summary>
		/// <param name="html">Html helper (used to get the HttpResponse object to render onto)</param>
		/// <param name="id">ID to give to the accordion (must be unique on the page)</param>
		/// <returns>Created ProgressBar control</returns>
		public static ProgressBar CreateProgressBar(this HtmlHelper html, string id) {
			TextWriter writer = html.ViewContext.Writer;
			ProgressBar pb = new ProgressBar(writer, id);

			return pb;
		}
Beispiel #8
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="pb">ProgressBar object to call</param>
		public Methods(ProgressBar pb) : base(pb)
		{
		}		
Beispiel #9
0
		public string JavaScriptCode(ProgressBar pb) {
			pb.Rendering.SetPrettyRender(true);
			return pb.GetStartUpScript();
		}
Beispiel #10
0
		public string JavaScriptCode(ProgressBar pb) {
			return pb.GetStartUpScript();
		}
Beispiel #11
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="pb">ProgressBar object to set rendering options of</param>
		public Rendering(ProgressBar pb)
		 : base()
		{
			this.ProgressBar = pb;
		}