private CheckMonthRange ( int month ) : void | ||
month | int | |
Résultat | void |
/// <summary>Returns the number of days in the specified month in the specified year in the specified era.</summary> /// <param name="year">An integer that represents the year. </param> /// <param name="month">An integer from 1 to 12 that represents the month. </param> /// <param name="era">An integer that represents the era. </param> /// <returns>The number of days in the specified month in the specified year in the specified era.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="era" /> is outside the range supported by the calendar. -or- /// <paramref name="year" /> is outside the range supported by the calendar.-or- /// <paramref name="month" /> is outside the range supported by the calendar. </exception> // Token: 0x06002F4E RID: 12110 RVA: 0x000B5554 File Offset: 0x000B3754 public override int GetDaysInMonth(int year, int month, int era) { this.CheckYearEraRange(year, era); JulianCalendar.CheckMonthRange(month); int[] array = (year % 4 == 0) ? JulianCalendar.DaysToMonth366 : JulianCalendar.DaysToMonth365; return(array[month] - array[month - 1]); }
/// <summary>Determines whether the specified date in the specified era is a leap day.</summary> /// <param name="year">An integer that represents the year. </param> /// <param name="month">An integer from 1 to 12 that represents the month. </param> /// <param name="day">An integer from 1 to 31 that represents the day. </param> /// <param name="era">An integer that represents the era. </param> /// <returns> /// <see langword="true" /> if the specified day is a leap day; otherwise, <see langword="false" />.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> is outside the range supported by the calendar.-or- /// <paramref name="month" /> is outside the range supported by the calendar.-or- /// <paramref name="day" /> is outside the range supported by the calendar. -or- /// <paramref name="era" /> is outside the range supported by the calendar. </exception> // Token: 0x06002F55 RID: 12117 RVA: 0x000B55E2 File Offset: 0x000B37E2 public override bool IsLeapDay(int year, int month, int day, int era) { JulianCalendar.CheckMonthRange(month); if (this.IsLeapYear(year, era)) { JulianCalendar.CheckDayRange(year, month, day); return(month == 2 && day == 29); } JulianCalendar.CheckDayRange(year, month, day); return(false); }
/// <summary>Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the specified era.</summary> /// <param name="year">An integer that represents the year. </param> /// <param name="month">An integer from 1 to 12 that represents the month. </param> /// <param name="day">An integer from 1 to 31 that represents the day. </param> /// <param name="hour">An integer from 0 to 23 that represents the hour. </param> /// <param name="minute">An integer from 0 to 59 that represents the minute. </param> /// <param name="second">An integer from 0 to 59 that represents the second. </param> /// <param name="millisecond">An integer from 0 to 999 that represents the millisecond. </param> /// <param name="era">An integer that represents the era. </param> /// <returns>The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> is outside the range supported by the calendar.-or- /// <paramref name="month" /> is outside the range supported by the calendar.-or- /// <paramref name="day" /> is outside the range supported by the calendar.-or- /// <paramref name="hour" /> is less than zero or greater than 23.-or- /// <paramref name="minute" /> is less than zero or greater than 59.-or- /// <paramref name="second" /> is less than zero or greater than 59.-or- /// <paramref name="millisecond" /> is less than zero or greater than 999. -or- /// <paramref name="era" /> is outside the range supported by the calendar. </exception> // Token: 0x06002F59 RID: 12121 RVA: 0x000B5640 File Offset: 0x000B3840 public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { this.CheckYearEraRange(year, era); JulianCalendar.CheckMonthRange(month); JulianCalendar.CheckDayRange(year, month, day); if (millisecond < 0 || millisecond >= 1000) { throw new ArgumentOutOfRangeException("millisecond", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 0, 999)); } if (hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60) { return(new DateTime(JulianCalendar.DateToTicks(year, month, day) + new TimeSpan(0, hour, minute, second, millisecond).Ticks)); } throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond")); }
/// <summary>Determines whether the specified month in the specified year in the specified era is a leap month.</summary> /// <param name="year">An integer that represents the year. </param> /// <param name="month">An integer from 1 to 12 that represents the month. </param> /// <param name="era">An integer that represents the era. </param> /// <returns>This method always returns <see langword="false" />, unless overridden by a derived class.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> is outside the range supported by the calendar.-or- /// <paramref name="month" /> is outside the range supported by the calendar. -or- /// <paramref name="era" /> is outside the range supported by the calendar. </exception> // Token: 0x06002F57 RID: 12119 RVA: 0x000B561D File Offset: 0x000B381D public override bool IsLeapMonth(int year, int month, int era) { this.CheckYearEraRange(year, era); JulianCalendar.CheckMonthRange(month); return(false); }