using System; using System.Runtime.InteropServices; namespace System.Globalization { /// Represents a calendar that divides time into months, days, years, and eras, and has dates that are based on cycles of the sun and the moon. // Token: 0x02000185 RID: 389 [ComVisible(true)] [Serializable] public abstract class EastAsianLunisolarCalendar : Calendar { // Token: 0x0600131C RID: 4892 RVA: 0x0004ADF8 File Offset: 0x00048FF8 internal EastAsianLunisolarCalendar(CCEastAsianLunisolarEraHandler eraHandler) { this.M_EraHandler = eraHandler; } /// Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. /// The last year of a 100-year range that can be represented by a 2-digit year. /// The current is read-only. /// The value in a set operation is less than 99 or greater than the maximum supported year in the current calendar. // Token: 0x1700034B RID: 843 // (get) Token: 0x0600131D RID: 4893 RVA: 0x0004AE08 File Offset: 0x00049008 // (set) Token: 0x0600131E RID: 4894 RVA: 0x0004AE10 File Offset: 0x00049010 public override int TwoDigitYearMax { get { return this.twoDigitYearMax; } set { base.CheckReadOnly(); base.M_ArgumentInRange("value", value, 100, this.M_MaxYear); this.twoDigitYearMax = value; } } // Token: 0x0600131F RID: 4895 RVA: 0x0004AE40 File Offset: 0x00049040 internal void M_CheckDateTime(DateTime time) { this.M_EraHandler.CheckDateTime(time); } // Token: 0x1700034C RID: 844 // (get) Token: 0x06001320 RID: 4896 RVA: 0x0004AE50 File Offset: 0x00049050 internal virtual int ActualCurrentEra { get { return 1; } } // Token: 0x06001321 RID: 4897 RVA: 0x0004AE54 File Offset: 0x00049054 internal void M_CheckEra(ref int era) { if (era == 0) { era = this.ActualCurrentEra; } if (!this.M_EraHandler.ValidEra(era)) { throw new ArgumentException("Era value was not valid."); } } // Token: 0x06001322 RID: 4898 RVA: 0x0004AE90 File Offset: 0x00049090 internal int M_CheckYEG(int year, ref int era) { this.M_CheckEra(ref era); return this.M_EraHandler.GregorianYear(year, era); } // Token: 0x06001323 RID: 4899 RVA: 0x0004AEA8 File Offset: 0x000490A8 internal override void M_CheckYE(int year, ref int era) { this.M_CheckYEG(year, ref era); } // Token: 0x06001324 RID: 4900 RVA: 0x0004AEB4 File Offset: 0x000490B4 internal int M_CheckYMEG(int year, int month, ref int era) { int num = this.M_CheckYEG(year, ref era); if (month < 1 || month > 12) { throw new ArgumentOutOfRangeException("month", "Month must be between one and twelve."); } return num; } // Token: 0x06001325 RID: 4901 RVA: 0x0004AEEC File Offset: 0x000490EC internal int M_CheckYMDEG(int year, int month, int day, ref int era) { int num = this.M_CheckYMEG(year, month, ref era); base.M_ArgumentInRange("day", day, 1, this.GetDaysInMonth(year, month, era)); return num; } /// Calculates the date that is the specified number of months away from the specified date. /// A new that results from adding the specified number of months to the parameter. /// The to which to add . /// The number of months to add. /// The result is outside the supported range of a . /// /// is less than -120000 or greater than 120000. -or- is less than or greater than . // Token: 0x06001326 RID: 4902 RVA: 0x0004AF20 File Offset: 0x00049120 [MonoTODO] public override DateTime AddMonths(DateTime time, int months) { DateTime dateTime = CCEastAsianLunisolarCalendar.AddMonths(time, months); this.M_CheckDateTime(dateTime); return dateTime; } /// Calculates the date that is the specified number of years away from the specified date. /// A new that results from adding the specified number of years to the parameter. /// The to which to add . /// The number of years to add. /// The result is outside the supported range of a . /// /// is less than or greater than . // Token: 0x06001327 RID: 4903 RVA: 0x0004AF40 File Offset: 0x00049140 [MonoTODO] public override DateTime AddYears(DateTime time, int years) { DateTime dateTime = CCEastAsianLunisolarCalendar.AddYears(time, years); this.M_CheckDateTime(dateTime); return dateTime; } /// Calculates the day of the month in the specified date. /// An integer from 1 through 31 that represents the day of the month specified in the parameter. /// The to read. // Token: 0x06001328 RID: 4904 RVA: 0x0004AF60 File Offset: 0x00049160 [MonoTODO] public override int GetDayOfMonth(DateTime time) { this.M_CheckDateTime(time); return CCEastAsianLunisolarCalendar.GetDayOfMonth(time); } /// Calculates the day of the week in the specified date. /// One of the values that represents the day of the week specified in the parameter. /// The to read. /// /// is less than or greater than . // Token: 0x06001329 RID: 4905 RVA: 0x0004AF70 File Offset: 0x00049170 [MonoTODO] public override DayOfWeek GetDayOfWeek(DateTime time) { this.M_CheckDateTime(time); int num = CCFixed.FromDateTime(time); return CCFixed.day_of_week(num); } /// Calculates the day of the year in the specified date. /// An integer from 1 through 354 in a common year, or 1 through 384 in a leap year, that represents the day of the year specified in the parameter. /// The to read. // Token: 0x0600132A RID: 4906 RVA: 0x0004AF94 File Offset: 0x00049194 [MonoTODO] public override int GetDayOfYear(DateTime time) { this.M_CheckDateTime(time); return CCEastAsianLunisolarCalendar.GetDayOfYear(time); } /// Calculates the number of days in the specified month of the specified year and era. /// The number of days in the specified month of the specified year and era. /// An integer that represents the year. /// An integer from 1 through 12 in a common year, or 1 through 13 in a leap year, that represents the month. /// An integer that represents the era. /// /// , , or is outside the range supported by this calendar. // Token: 0x0600132B RID: 4907 RVA: 0x0004AFA4 File Offset: 0x000491A4 [MonoTODO] public override int GetDaysInMonth(int year, int month, int era) { int num = this.M_CheckYMEG(year, month, ref era); return CCEastAsianLunisolarCalendar.GetDaysInMonth(num, month); } /// Calculates the number of days in the specified year and era. /// The number of days in the specified year and era. /// An integer that represents the year. /// An integer that represents the era. /// /// or is outside the range supported by this calendar. // Token: 0x0600132C RID: 4908 RVA: 0x0004AFC4 File Offset: 0x000491C4 [MonoTODO] public override int GetDaysInYear(int year, int era) { int num = this.M_CheckYEG(year, ref era); return CCEastAsianLunisolarCalendar.GetDaysInYear(num); } /// Calculates the leap month for the specified year and era. /// A positive integer from 1 through 13 that indicates the leap month in the specified year and era. -or-Zero if this calendar does not support a leap month, or if the and parameters do not specify a leap year. /// An integer that represents the year. /// An integer that represents the era. // Token: 0x0600132D RID: 4909 RVA: 0x0004AFE4 File Offset: 0x000491E4 [MonoTODO] public override int GetLeapMonth(int year, int era) { return base.GetLeapMonth(year, era); } /// Returns the month in the specified date. /// An integer from 1 to 13 that represents the month specified in the parameter. /// The to read. // Token: 0x0600132E RID: 4910 RVA: 0x0004AFF0 File Offset: 0x000491F0 [MonoTODO] public override int GetMonth(DateTime time) { this.M_CheckDateTime(time); return CCEastAsianLunisolarCalendar.GetMonth(time); } /// Calculates the number of months in the specified year and era. /// The number of months in the specified year in the specified era. The return value is 12 months in a common year or 13 months in a leap year. /// An integer that represents the year. /// An integer that represents the era. /// /// or is outside the range supported by this calendar. // Token: 0x0600132F RID: 4911 RVA: 0x0004B000 File Offset: 0x00049200 [MonoTODO] public override int GetMonthsInYear(int year, int era) { this.M_CheckYE(year, ref era); return (!this.IsLeapYear(year, era)) ? 12 : 13; } /// Returns the year in the specified date. /// An integer that represents the year in the specified . /// The to read. // Token: 0x06001330 RID: 4912 RVA: 0x0004B024 File Offset: 0x00049224 public override int GetYear(DateTime time) { int num = CCFixed.FromDateTime(time); int num2; return this.M_EraHandler.EraYear(out num2, num); } /// Determines whether the specified date in the specified era is a leap day. /// true if the specified day is a leap day; otherwise, false. /// An integer that represents the year. /// An integer from 1 through 13 that represents the month. /// An integer from 1 through 31 that represents the day. /// An integer that represents the era. /// /// , , , or is outside the range supported by this calendar. // Token: 0x06001331 RID: 4913 RVA: 0x0004B048 File Offset: 0x00049248 public override bool IsLeapDay(int year, int month, int day, int era) { int num = this.M_CheckYMDEG(year, month, day, ref era); return CCEastAsianLunisolarCalendar.IsLeapMonth(num, month); } /// Determines whether the specified month in the specified year and era is a leap month. /// true if the parameter is a leap month; otherwise, false. /// An integer that represents the year. /// An integer from 1 through 13 that represents the month. /// An integer that represents the era. /// /// , , or is outside the range supported by this calendar. // Token: 0x06001332 RID: 4914 RVA: 0x0004B068 File Offset: 0x00049268 [MonoTODO] public override bool IsLeapMonth(int year, int month, int era) { int num = this.M_CheckYMEG(year, month, ref era); return CCEastAsianLunisolarCalendar.IsLeapMonth(num, month); } /// Determines whether the specified year in the specified era is a leap year. /// true if the specified year is a leap year; otherwise, false. /// An integer that represents the year. /// An integer that represents the era. /// /// or is outside the range supported by this calendar. // Token: 0x06001333 RID: 4915 RVA: 0x0004B088 File Offset: 0x00049288 public override bool IsLeapYear(int year, int era) { int num = this.M_CheckYEG(year, ref era); return CCEastAsianLunisolarCalendar.IsLeapYear(num); } /// Returns a that is set to the specified date, time, and era. /// A that is set to the specified date, time, and era. /// An integer that represents the year. /// An integer from 1 through 13 that represents the month. /// An integer from 1 through 31 that represents the day. /// An integer from 0 through 23 that represents the hour. /// An integer from 0 through 59 that represents the minute. /// An integer from 0 through 59 that represents the second. /// An integer from 0 through 999 that represents the millisecond. /// An integer that represents the era. /// /// , , , , , , , or is outside the range supported by this calendar. // Token: 0x06001334 RID: 4916 RVA: 0x0004B0A8 File Offset: 0x000492A8 [MonoTODO] public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { int num = this.M_CheckYMDEG(year, month, day, ref era); base.M_CheckHMSM(hour, minute, second, millisecond); return CCGregorianCalendar.ToDateTime(num, month, day, hour, minute, second, millisecond); } /// Converts the specified year to a four-digit year. /// An integer that contains the four-digit representation of the parameter. /// A two-digit or four-digit integer that represents the year to convert. /// /// is outside the range supported by this calendar. // Token: 0x06001335 RID: 4917 RVA: 0x0004B0E0 File Offset: 0x000492E0 [MonoTODO] public override int ToFourDigitYear(int year) { if (year < 0) { throw new ArgumentOutOfRangeException("year", "Non-negative number required."); } int num = 0; this.M_CheckYE(year, ref num); return year; } /// Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. /// This property always returns the value. // Token: 0x1700034D RID: 845 // (get) Token: 0x06001336 RID: 4918 RVA: 0x0004B110 File Offset: 0x00049310 public override CalendarAlgorithmType AlgorithmType { get { return CalendarAlgorithmType.LunisolarCalendar; } } /// Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle. /// A number from 1 through 10. /// An integer from 1 through 60 that represents a year in the sexagenary cycle. /// /// is less than 1 or greater than 60. // Token: 0x06001337 RID: 4919 RVA: 0x0004B114 File Offset: 0x00049314 public int GetCelestialStem(int sexagenaryYear) { if (sexagenaryYear < 1 || 60 < sexagenaryYear) { throw new ArgumentOutOfRangeException("sexagendaryYear is less than 0 or greater than 60"); } return (sexagenaryYear - 1) % 10 + 1; } /// Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date. /// A number from 1 through 60 in the sexagenary cycle that corresponds to the parameter. /// A to read. // Token: 0x06001338 RID: 4920 RVA: 0x0004B144 File Offset: 0x00049344 public virtual int GetSexagenaryYear(DateTime time) { return (this.GetYear(time) - 1900) % 60; } /// Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle. /// An integer from 1 through 12. /// An integer from 1 through 60 that represents a year in the sexagenary cycle. /// /// is less than 1 or greater than 60. // Token: 0x06001339 RID: 4921 RVA: 0x0004B158 File Offset: 0x00049358 public int GetTerrestrialBranch(int sexagenaryYear) { if (sexagenaryYear < 1 || 60 < sexagenaryYear) { throw new ArgumentOutOfRangeException("sexagendaryYear is less than 0 or greater than 60"); } return (sexagenaryYear - 1) % 12 + 1; } // Token: 0x04000559 RID: 1369 internal readonly CCEastAsianLunisolarEraHandler M_EraHandler; } }