Пример #1
0
		protected string OptionsCSharpCode() {
			jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 2);

			if (this.Disabled)
				sb.AppendTabsLineIf(".SetDisabled(true)");
			if (!string.IsNullOrEmpty(this.AltField))
				sb.AppendTabsFormatLineIf(".SetAltField(\"{0}\")", this.AltField);
			if (!string.IsNullOrEmpty(this.AltFormat))
				sb.AppendTabsFormatLineIf(".SetAltFormat(\"{0}\")", this.AltFormat);
			if (!string.IsNullOrEmpty(this.AppendText))
				sb.AppendTabsFormatLineIf(".SetAppendText(\"{0}\")", this.AppendText);
			if (this.AutoSize)
				sb.AppendTabsLineIf(".SetAutoSize(true)");
			if (!string.IsNullOrEmpty(this.ButtonImage))
				sb.AppendTabsFormatLineIf(".SetButtonImage(\"{0}\")", this.ButtonImage);
			if (this.ButtonImageOnly)
				sb.AppendTabsLineIf(".SetButtonImageOnly(true)");
			if (!Utils.IsNullEmptyOrDefault(this.ButtonText, Options.DEFAULT_BUTTON_TEXT))
				sb.AppendTabsFormatLineIf(".SetButtonText(\"{0}\")", this.ButtonText);
			if (!Utils.IsNullEmptyOrDefault(this.CalculateWeek, Options.DEFAULT_CALCULATE_WEEK) )
				sb.AppendTabsFormatLineIf(".SetCalculateWeek(\"{0}\")", this.CalculateWeek);
			if (this.ChangeMonth)
				sb.AppendTabsLineIf(".SetChangeMonth(true)");
			if (this.ChangeYear)
				sb.AppendTabsLineIf(".SetChangeYear(true)");
			if (!Utils.IsNullEmptyOrDefault(this.CloseText, Options.DEFAULT_CLOSE_TEXT))
				sb.AppendTabsFormatLineIf(".SetCloseText(\"{0}\")", this.CloseText);
			if (!this.ConstrainInput)
				sb.AppendTabsLineIf(".SetConstraintInput(false)");
			if (!Utils.IsNullEmptyOrDefault(this.CurrentText, Options.DEFAULT_CURRENT_TEXT))
				sb.AppendTabsFormatLineIf(".SetCurrentText(\"{0}\")", this.CurrentText);
			if (!Utils.IsNullEmptyOrDefault(this.DateFormat, Options.DEFAULT_DATE_FORMAT))
				sb.AppendTabsFormatLineIf(".SetDateFormat({0})", Utils.AddQuotesToJQueryDate(this.DateFormat));
			if (!Utils.IsNullEmptyOrDefault(this.Duration, Options.DEFAULT_DURATION))
				sb.AppendTabsFormatLineIf(".SetDuration(\"{0}\")", this.Duration);
			if (this.FirstDay != Options.DEFAULT_FIRST_DAY)
				sb.AppendTabsFormatLineIf(".SetFirstDay({0})", this.FirstDay);
			if (this.GotoCurrent)
				sb.AppendTabsLineIf(".SetGotoCurrent(true)");
			if (this.HideIfNoPrevNext)
				sb.AppendTabsLineIf(".SetHideIfNoPrevNext(true)");
			if (this.IsRTL)
				sb.AppendTabsLineIf(".SetIsRTL(true)");
			if (!string.IsNullOrEmpty(this.MinDate))
				sb.AppendTabsFormatLineIf(".SetMinDate({0})", Utils.AddQuotesToJQueryDate(this.MinDate));
			if (!string.IsNullOrEmpty(this.MaxDate))
				sb.AppendTabsFormatLineIf(".SetMaxDate({0})", Utils.AddQuotesToJQueryDate(this.MaxDate));

			if (this.NavigationAsDateFormat)
				sb.AppendTabsLineIf(".SetNavigationAsDateFormat(true)");
			if (!Utils.IsNullEmptyOrDefault(this.NextText, Options.DEFAULT_NEXT_TEXT))
				sb.AppendTabsFormatLineIf(".SetNextText(\"{0}\")", this.NextText);
			if (!Utils.IsNullEmptyOrDefault(this.PrevText, Options.DEFAULT_PREV_TEXT))
				sb.AppendTabsFormatLineIf(".SetPrevText(\"{0}\")", this.PrevText);
			if (this.NumberOfMonths != Options.DEFAULT_NUMBER_OF_MONTHS) {
				sb.AppendTabsFormatLineIf(".SetNumberOfMonths({0})", this.NumberOfMonths);
			}
			if (this.SelectOtherMonths)
				sb.AppendTabsLineIf(".SetSelectOtherMonths(true)");
			if (!Utils.IsNullEmptyOrDefault(this.ShortYearCutoff, Options.DEFAULT_SHORT_YEAR_CUTOFF))
				sb.AppendTabsFormatLineIf(".SetShortYearCutoff(\"{0}\")", this.ShortYearCutoff);
			if (!Utils.IsNullEmptyOrDefault(this.ShowAnim, Options.DEFAULT_SHOW_ANIM))
				sb.AppendTabsFormatLineIf(".SetShowAnim(\"{0}\")", this.ShowAnim);
			if (this.ShowButtonPanel)
				sb.AppendTabsLineIf(".SetShowButtonPanel(true)");
			if (this.ShowCurrentAtPos != Options.DEFAULT_SHOW_CURRENT_AT_POS)
				sb.AppendTabsFormatLineIf(".SetShowCurrentAtPos({0})", this.ShowCurrentAtPos);
			if (this.ShowMonthAfterYear)
				sb.AppendTabsFormatLine(".SetShowMonthAfterYear(true)");
			if (!Utils.IsNullEmptyOrDefault(this.ShowOn, Options.DEFAULT_SHOW_ON))
				sb.AppendTabsFormatLineIf(".SetShowOn(\"{0}\")", this.ShowOn);
			if (this.ShowOtherMonths)
				sb.AppendTabsFormatLineIf(".SetShowOtherMonths({0})", this.ShowOtherMonths);
			if (this.ShowWeek)
				sb.AppendTabsLineIf(".SetShowWeek(true)");
			if (this.StepMonths != Options.DEFAULT_STEP_MONTHS)
				sb.AppendTabsFormatLineIf(".SetStepMonths({0})", this.StepMonths);
			if (!Utils.IsNullEmptyOrDefault(this.WeekHeader, Options.DEFAULT_WEEK_HEADER))
				sb.AppendTabsFormatLineIf(".SetWeekHeader(\"{0}\")", this.WeekHeader);
			if (!Utils.IsNullEmptyOrDefault(this.YearRange, Options.DEFAULT_YEAR_RANGE))
				sb.AppendTabsFormatLineIf(".SetYearRange(\"{0}\")", this.YearRange);
			if (!string.IsNullOrEmpty(this.YearSuffix))
				sb.AppendTabsFormatLineIf(".SetYearSuffix(\"{0}\")", this.YearSuffix);

			if (this.FakeDayNamesChange) {
				if (!Utils.IsNullEmptyOrDefault(this.DayNames, Options.DEFAULT_DAY_NAMES))
					sb.AppendTabsFormatLineIf(".SetDayNames(\"{0}\")", this.DayNames.JsArray());
				if (!Utils.IsNullEmptyOrDefault(this.DayNamesMin, Options.DEFAULT_DAY_NAMES_MIN))
					sb.AppendTabsFormatLineIf(".SetDayNamesMin(\"{0}\")", this.DayNamesMin.JsArray());
				if (!Utils.IsNullEmptyOrDefault(this.DayNamesShort, Options.DEFAULT_DAY_NAMES_SHORT))
					sb.AppendTabsFormatLineIf(".SetDayNamesShort(\"{0}\")", this.DayNamesShort.JsArray());
			}
			if (this.FakeMonthNamesChange) {
				if (!Utils.IsNullEmptyOrDefault(this.MonthNames, Options.DEFAULT_MONTH_NAMES))
					sb.AppendTabsFormatLineIf(".SetMonthNames(\"{0}\")", this.MonthNames.JsArray());
				if (!Utils.IsNullEmptyOrDefault(this.MonthNamesShort, Options.DEFAULT_MONTH_NAMES_SHORT))
					sb.AppendTabsFormatLineIf(".SetMonthNamesShort(\"{0}\")", this.MonthNamesShort.JsArray());
			}
			return sb.ToString();
		}