コード例 #1
0
ファイル: TestHelper.cs プロジェクト: akhuang/Fluqi
		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
ファイル: WizardModel.cs プロジェクト: xuanvu/Fluqi
		public void ConfigureDatePicker(DatePicker dt) {
			dt
				.Rendering
					.SetAutoScript(false)
					.SetTabDepth(1)
				.Finish()
				.Options
					.SetShowOn("both")
					.SetChangeYear(true)
					.SetChangeMonth(true)
					.SetYearRange("-100")
			;
		}
コード例 #3
0
ファイル: Events-Properties.cs プロジェクト: akhuang/Fluqi
		/// <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
ファイル: DatePickerModel.cs プロジェクト: toepoke/Fluqi
		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
ファイル: DatePickerModel.cs プロジェクト: toepoke/Fluqi
		public string JavaScriptCode(DatePicker dt) {
			dt.Rendering.SetPrettyRender(true);
			return dt.GetStartUpScript();
		}
コード例 #7
0
ファイル: DatePickerModel.cs プロジェクト: toepoke/Fluqi
		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
ファイル: Options-Properties.cs プロジェクト: xuanvu/Fluqi
		/// <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
ファイル: DatePickerModel.cs プロジェクト: xuanvu/Fluqi
		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;
		}