Пример #1
0
		public void ConfigureSpinner(Spinner spin) {
			spin
				.Rendering
					.SetPrettyRender(true)
				.Finish()
				.Options
					.SetDisabled(this.disabled)
					.SetIcons(this.downIconClass, this.upIconClass)
					.SetMin(this.min)
					.SetMax(this.max)
					.SetPage(this.page)
					.SetStep(this.step)
				.Finish();

			if (this.showEvents) {
				spin
					.Events
						.SetChangeEvent("return changeEvent(event, ui);")
						.SetCreateEvent("return createEvent(event, ui);")
						.SetSpinEvent("return spinEvent(event, ui);")
						.SetStartEvent("return startEvent(event, ui);")
						.SetStopEvent("return stopEvent(event, ui);")
					.Finish();
			}
			if (!this.prettyRender)
				spin.Rendering.Compress();
			if (this.renderCSS)
				spin.Rendering.ShowCSS();
		}
Пример #2
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="sldr">Spinner to configure options of</param>
		public Options(Spinner spinner)
		 : base()
		{
			this.Spinner = spinner;
			this.Reset();
		}
Пример #3
0
		internal static void ForceRender(Spinner s)
		{
			s.Render();
		}
Пример #4
0
		internal static Spinner SetupSimpleSpinnerObject(TextWriter writer)
		{
			Spinner s = new Spinner(writer, "mySpinner");

			return s;
		}
Пример #5
0
		/// <summary>
		/// Creates a Spinner control that can be configured and later rendered on 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 Spinner control</returns>
		public static Spinner CreateSpinner(this System.Web.UI.Page page, string id) {
			TextWriter writer = page.Response.Output;
			Spinner newSpinner = new Spinner(writer, id);

			return newSpinner;
		}
Пример #6
0
		/// <summary>
		/// Creates a Spinner control that can be configured and later rendered on 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 Spinner control</returns>
		public static Spinner CreateSpinner(this HtmlHelper html, string id) {
			TextWriter writer = html.ViewContext.Writer;
			Spinner newSpinner = new Spinner(writer, id);

			return newSpinner;
		}
Пример #7
0
		public string CSharpCode(Spinner spin) {
			jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);

			sb.AppendTabsLineIf("<%");
			sb.AppendTabsLineIf("Html.CreateSpinner(\"spin\")");

			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();
		}
Пример #8
0
		public string JavaScriptCode(Spinner spin) {
			return spin.GetStartUpScript();
		}
Пример #9
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="spin">Spinner object to configure events for</param>
		public Events(Spinner spin)
		 : base()
		{
			this.Spinner = spin;
			this.Reset();
		}
Пример #10
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="spinner">Spinner object to call</param>
		public Methods(Spinner spinner) : base(spinner)
		{
		}		
Пример #11
0
		public string JavaScriptCode(Spinner spin) {
			spin.Rendering.SetPrettyRender(true);
			return spin.GetStartUpScript();
		}