CheckYearRange() 개인적인 메소드

private CheckYearRange ( int year, int era ) : void
year int
era int
리턴 void
예제 #1
0
 /// <summary>Returns the number of months in the specified year of the specified era.</summary>
 /// <param name="year">An integer from 1 through 9378 that represents the year. </param>
 /// <param name="era">An integer from 0 through 1 that represents the era. </param>
 /// <returns>Returns 10 if the <paramref name="year" /> parameter is 9378; otherwise, always returns 12.</returns>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///         <paramref name="year" /> or <paramref name="era" /> is outside the range supported by this calendar. </exception>
 // Token: 0x06002F87 RID: 12167 RVA: 0x000B5E1F File Offset: 0x000B401F
 public override int GetMonthsInYear(int year, int era)
 {
     PersianCalendar.CheckYearRange(year, era);
     if (year == 9378)
     {
         return(10);
     }
     return(12);
 }
예제 #2
0
 // Token: 0x06002F79 RID: 12153 RVA: 0x000B5AF0 File Offset: 0x000B3CF0
 internal static void CheckYearMonthRange(int year, int month, int era)
 {
     PersianCalendar.CheckYearRange(year, era);
     if (year == 9378 && month > 10)
     {
         throw new ArgumentOutOfRangeException("month", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, 10));
     }
     if (month < 1 || month > 12)
     {
         throw new ArgumentOutOfRangeException("month", Environment.GetResourceString("ArgumentOutOfRange_Month"));
     }
 }
예제 #3
0
 /// <summary>Returns the number of days in the specified year of the specified era.</summary>
 /// <param name="year">An integer from 1 through 9378 that represents the year. </param>
 /// <param name="era">An integer from 0 through 1 that represents the era. </param>
 /// <returns>The number of days in the specified year and era. The number of days is 365 in a common year or 366 in a leap year.</returns>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///         <paramref name="year" /> or <paramref name="era" /> is outside the range supported by this calendar. </exception>
 // Token: 0x06002F83 RID: 12163 RVA: 0x000B5DBA File Offset: 0x000B3FBA
 public override int GetDaysInYear(int year, int era)
 {
     PersianCalendar.CheckYearRange(year, era);
     if (year == 9378)
     {
         return(PersianCalendar.DaysToMonth[9] + 13);
     }
     if (!this.IsLeapYear(year, 0))
     {
         return(365);
     }
     return(366);
 }
예제 #4
0
 /// <summary>Determines whether the specified year in the specified era is a leap year.</summary>
 /// <param name="year">An integer from 1 through 9378 that represents the year. </param>
 /// <param name="era">An integer from 0 through 1 that represents the era. </param>
 /// <returns>
 ///     <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" />.</returns>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///         <paramref name="year" /> or <paramref name="era" /> is outside the range supported by this calendar. </exception>
 // Token: 0x06002F8C RID: 12172 RVA: 0x000B5EBF File Offset: 0x000B40BF
 public override bool IsLeapYear(int year, int era)
 {
     PersianCalendar.CheckYearRange(year, era);
     return(year != 9378 && this.GetAbsoluteDatePersian(year + 1, 1, 1) - this.GetAbsoluteDatePersian(year, 1, 1) == 366L);
 }
예제 #5
0
 /// <summary>Returns the leap month for a specified year and era.</summary>
 /// <param name="year">An integer from 1 through 9378 that represents the year to convert. </param>
 /// <param name="era">An integer from 0 through 1 that represents the era. </param>
 /// <returns>The return value is always 0.</returns>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///         <paramref name="year" /> or <paramref name="era" /> is outside the range supported by this calendar. </exception>
 // Token: 0x06002F8A RID: 12170 RVA: 0x000B5EAA File Offset: 0x000B40AA
 public override int GetLeapMonth(int year, int era)
 {
     PersianCalendar.CheckYearRange(year, era);
     return(0);
 }