/// <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); }
// 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")); } }
/// <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); }
/// <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); }
/// <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); }