示例#1
0
		internal static DatePicker SetupSimpleDatePickerObject(TextWriter writer) 
		{
			// nothing special, just create a simple dummy tab helper as a starting point 
			// (saves having the same code everywhere!)
			DatePicker dt = new DatePicker(writer, "dt");

			return dt;
		}
示例#2
0
		public void ConfigureDatePicker(DatePicker dt) {
			dt
				.Rendering
					.SetAutoScript(false)
					.SetTabDepth(1)
				.Finish()
				.Options
					.SetShowOn("both")
					.SetChangeYear(true)
					.SetChangeMonth(true)
					.SetYearRange("-100")
			;
		}
示例#3
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="dp">DatePicker object to define events for</param>
		public Events(DatePicker dp)
		 : base()
		{
			this.DatePicker = dp;
			this.Reset();
		}
示例#4
0
		public void ConfigureDatePicker(DatePicker dt) {

			// make the input a bit wider than our default style
			dt.WithCss("wide");

			dt
				.Rendering
					.SetPrettyRender(true)
				.Finish()
				.Options
					.SetDisabled(this.Disabled)
					.SetAltField(this.AltField)
					.SetAltFormat(this.AltFormat)
					.SetAppendText(this.AppendText)
					.SetAutoSize(this.AutoSize)
					.SetButtonImage(this.ButtonImage)
					.SetButtonImageOnly(this.ButtonImageOnly)
					.SetButtonText(this.ButtonText)
					.SetCalculateWeek(this.CalculateWeek)
					.SetChangeMonth(this.ChangeMonth)
					.SetChangeYear(this.ChangeYear)
					.SetCloseText(this.CloseText)
					.SetConstrainInput(this.ConstrainInput)
					.SetCurrentText(this.CurrentText)
					.SetDateFormat(this.DateFormat)
					.SetDefaultDate(this.DefaultDate)
					.SetDuration(this.Duration)
					.SetFirstDay(this.FirstDay)
					.SetGotoCurrent(this.GotoCurrent)
					.SetHideIfNoPrevNext(this.HideIfNoPrevNext)
					.SetIsRTL(this.IsRTL)
					.SetMaxDate(this.MaxDate)
					.SetMinDate(this.MinDate)
					.SetNavigationAsDateFormat(this.NavigationAsDateFormat)
					.SetNextText(this.NextText)
					.SetNumberOfMonths(this.NumberOfMonths)
					.SetPrevText(this.PrevText)
					.SetSelectOtherMonths(this.SelectOtherMonths)
					.SetShortYearCutoff(this.ShortYearCutoff)
					.SetShowAnim(this.ShowAnim)
					.SetShowButtonPanel(this.ShowButtonPanel)
					.SetShowMonthAfterYear(this.ShowMonthAfterYear)
					.SetShowOn(this.ShowOn)
					.SetShowOtherMonths(this.ShowOtherMonths)
					.SetShowWeek(this.ShowWeek)
					.SetStepMonths(this.StepMonths)
					.SetWeekHeader(this.WeekHeader)
					.SetYearRange(this.YearRange)
					.SetYearSuffix(this.YearSuffix)
					.SetShowInline(this.ShowInline)
				.Finish();
				
			if (this.FakeDayNamesChange) {
				dt.Options
					.SetDayNames(this.DayNames)
					.SetDayNamesMin(this.DayNamesMin)
					.SetDayNamesShort(this.DayNamesShort)
				.Finish();
			}
			if (this.FakeMonthNamesChange) {
				dt.Options
					.SetMonthNames(this.MonthNames)
					.SetMonthNamesShort(this.MonthNamesShort)
				.Finish();
			}

			if (this.showEvents) {
				dt.Events
					.SetCreateEvent("return createEvent(event, ui);")
					.SetBeforeShowEvent("return beforeShowEvent(input, inst);")
					.SetBeforeShowDayEvent("return beforeShowDayEvent(date);")
					.SetOnChangeMonthYearEvent("return onChangeMonthYear(year, month, inst);")
					.SetOnCloseEvent("return onClose(dateText, inst);")
					.SetOnSelectEvent("return onSelect(dateText, inst);")
					.Finish()
				;
			}
			if (!this.prettyRender)
				dt.Rendering.Compress();
			if (this.renderCSS)
				dt.Rendering.ShowCSS();
		}
示例#5
0
文件: Methods.cs 项目: xuanvu/Fluqi
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="dp">DatePicker object to call</param>
		public Methods(DatePicker dp) 
			: base(dp)
		{
		}		
示例#6
0
		public string JavaScriptCode(DatePicker dt) {
			dt.Rendering.SetPrettyRender(true);
			return dt.GetStartUpScript();
		}
示例#7
0
		public string CSharpCode(DatePicker dt) {
			jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);

			sb.AppendTabsLineIf("<%");
			sb.AppendTabsFormatLineIf("Html.CreateDatePicker(\"{0}\")", dt.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();
		}
示例#8
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="dp">DatePicker to configure options of</param>
		public Options(DatePicker dp)
		 : base()
		{
			this.DatePicker = dp;
			this.Reset();
		}
示例#9
0
		/// <summary>
		/// Creates a DatePicker control that can be 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 DatePicker control</returns>
		public static DatePicker CreateDatePicker(this System.Web.UI.Page page, string id) {
			TextWriter writer = page.Response.Output;
			DatePicker newTabs = new DatePicker(writer, id);

			return newTabs;
		}
示例#10
0
		/// <summary>
		/// Creates a DatePicker control that can be 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 DatePicker control</returns>
		public static DatePicker CreateDatePicker(this HtmlHelper html, string id) {
			TextWriter writer = html.ViewContext.Writer;
			DatePicker newTabs = new DatePicker(writer, id);

			return newTabs;
		}
示例#11
0
		public string JavaScriptCode(DatePicker dt) {
			return dt.GetStartUpScript();
		}
示例#12
0
文件: Rendering.cs 项目: xuanvu/Fluqi
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="dt">DatePicker object to set rendering options of</param>
		public Rendering(DatePicker dt)
		 : base()
		{
			this.DatePicker = dt;
		}