using System; using System.Runtime.InteropServices; namespace System.Globalization { /// Represents the Japanese calendar. // Token: 0x0200018D RID: 397 [ComVisible(true)] [MonoTODO("Serialization format not compatible with .NET")] [Serializable] public class JapaneseCalendar : Calendar { /// Initializes a new instance of the class. // Token: 0x060013B9 RID: 5049 RVA: 0x0004CDC8 File Offset: 0x0004AFC8 public JapaneseCalendar() { this.M_AbbrEraNames = new string[] { "M", "T", "S", "H" }; this.M_EraNames = new string[] { "Meiji", "Taisho", "Showa", "Heisei" }; } // Token: 0x060013BA RID: 5050 RVA: 0x0004CE34 File Offset: 0x0004B034 static JapaneseCalendar() { JapaneseCalendar.M_EraHandler.appendEra(1, CCGregorianCalendar.fixed_from_dmy(8, 9, 1868), CCGregorianCalendar.fixed_from_dmy(29, 7, 1912)); JapaneseCalendar.M_EraHandler.appendEra(2, CCGregorianCalendar.fixed_from_dmy(30, 7, 1912), CCGregorianCalendar.fixed_from_dmy(24, 12, 1926)); JapaneseCalendar.M_EraHandler.appendEra(3, CCGregorianCalendar.fixed_from_dmy(25, 12, 1926), CCGregorianCalendar.fixed_from_dmy(7, 1, 1989)); JapaneseCalendar.M_EraHandler.appendEra(4, CCGregorianCalendar.fixed_from_dmy(8, 1, 1989)); } /// Gets the list of eras in the . /// An array of integers that represents the eras in the . // Token: 0x17000360 RID: 864 // (get) Token: 0x060013BB RID: 5051 RVA: 0x0004CF00 File Offset: 0x0004B100 public override int[] Eras { get { return (int[])JapaneseCalendar.M_EraHandler.Eras.Clone(); } } /// 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. /// /// /// /// // Token: 0x17000361 RID: 865 // (get) Token: 0x060013BC RID: 5052 RVA: 0x0004CF18 File Offset: 0x0004B118 // (set) Token: 0x060013BD RID: 5053 RVA: 0x0004CF20 File Offset: 0x0004B120 public override int TwoDigitYearMax { get { return this.twoDigitYearMax; } set { base.CheckReadOnly(); base.M_ArgumentInRange("value", value, 100, this.M_MaxYear); this.twoDigitYearMax = value; } } // Token: 0x060013BE RID: 5054 RVA: 0x0004CF50 File Offset: 0x0004B150 internal void M_CheckDateTime(DateTime time) { JapaneseCalendar.M_EraHandler.CheckDateTime(time); } // Token: 0x060013BF RID: 5055 RVA: 0x0004CF60 File Offset: 0x0004B160 internal void M_CheckEra(ref int era) { if (era == 0) { era = 4; } if (!JapaneseCalendar.M_EraHandler.ValidEra(era)) { throw new ArgumentException("Era value was not valid."); } } // Token: 0x060013C0 RID: 5056 RVA: 0x0004CF94 File Offset: 0x0004B194 internal int M_CheckYEG(int year, ref int era) { this.M_CheckEra(ref era); return JapaneseCalendar.M_EraHandler.GregorianYear(year, era); } // Token: 0x060013C1 RID: 5057 RVA: 0x0004CFAC File Offset: 0x0004B1AC internal override void M_CheckYE(int year, ref int era) { this.M_CheckYEG(year, ref era); } // Token: 0x060013C2 RID: 5058 RVA: 0x0004CFB8 File Offset: 0x0004B1B8 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: 0x060013C3 RID: 5059 RVA: 0x0004CFF0 File Offset: 0x0004B1F0 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; } /// Returns a that is the specified number of months away from the specified . /// The that results from adding the specified number of months to the specified . /// The to which to add months. /// The number of months to add. /// The resulting is outside the supported range. /// /// is less than -120000.-or- is greater than 120000. // Token: 0x060013C4 RID: 5060 RVA: 0x0004D024 File Offset: 0x0004B224 public override DateTime AddMonths(DateTime time, int months) { DateTime dateTime = CCGregorianCalendar.AddMonths(time, months); this.M_CheckDateTime(dateTime); return dateTime; } /// Returns a that is the specified number of years away from the specified . /// The that results from adding the specified number of years to the specified . /// The to which to add years. /// The number of years to add. /// The resulting is outside the supported range. /// /// is outside the supported range of the type.-or- is less than -10,000 or greater than 10,000. // Token: 0x060013C5 RID: 5061 RVA: 0x0004D044 File Offset: 0x0004B244 public override DateTime AddYears(DateTime time, int years) { DateTime dateTime = CCGregorianCalendar.AddYears(time, years); this.M_CheckDateTime(dateTime); return dateTime; } /// Returns the day of the month in the specified . /// An integer from 1 to 31 that represents the day of the month in the specified . /// The to read. // Token: 0x060013C6 RID: 5062 RVA: 0x0004D064 File Offset: 0x0004B264 public override int GetDayOfMonth(DateTime time) { this.M_CheckDateTime(time); return CCGregorianCalendar.GetDayOfMonth(time); } /// Returns the day of the week in the specified . /// A value that represents the day of the week in the specified . /// The to read. // Token: 0x060013C7 RID: 5063 RVA: 0x0004D074 File Offset: 0x0004B274 public override DayOfWeek GetDayOfWeek(DateTime time) { this.M_CheckDateTime(time); int num = CCFixed.FromDateTime(time); return CCFixed.day_of_week(num); } /// Returns the day of the year in the specified . /// An integer from 1 to 366 that represents the day of the year in the specified . /// The to read. // Token: 0x060013C8 RID: 5064 RVA: 0x0004D098 File Offset: 0x0004B298 public override int GetDayOfYear(DateTime time) { this.M_CheckDateTime(time); return CCGregorianCalendar.GetDayOfYear(time); } /// Returns the number of days in the specified month in the specified year in the specified era. /// The number of days in the specified month in the specified year in the specified era. /// An integer that represents the year. /// An integer from 1 to 12 that represents the month. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013C9 RID: 5065 RVA: 0x0004D0A8 File Offset: 0x0004B2A8 public override int GetDaysInMonth(int year, int month, int era) { int num = this.M_CheckYMEG(year, month, ref era); return CCGregorianCalendar.GetDaysInMonth(num, month); } /// Returns the number of days in the specified year in the specified era. /// The number of days in the specified year in the specified era. /// An integer that represents the year. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013CA RID: 5066 RVA: 0x0004D0C8 File Offset: 0x0004B2C8 public override int GetDaysInYear(int year, int era) { int num = this.M_CheckYEG(year, ref era); return CCGregorianCalendar.GetDaysInYear(num); } /// Returns the era in the specified . /// An integer that represents the era in the specified . /// The to read. /// The resulting is outside the supported range. // Token: 0x060013CB RID: 5067 RVA: 0x0004D0E8 File Offset: 0x0004B2E8 public override int GetEra(DateTime time) { int num = CCFixed.FromDateTime(time); int num2; JapaneseCalendar.M_EraHandler.EraYear(out num2, num); return num2; } /// Calculates the leap month for a specified year and era. /// The return value is always 0 because the type does not support the notion of a leap month. /// A year. /// An era. /// /// or is outside the range supported by the type. // Token: 0x060013CC RID: 5068 RVA: 0x0004D10C File Offset: 0x0004B30C [ComVisible(false)] public override int GetLeapMonth(int year, int era) { return 0; } /// Returns the month in the specified . /// An integer from 1 to 12 that represents the month in the specified . /// The to read. // Token: 0x060013CD RID: 5069 RVA: 0x0004D110 File Offset: 0x0004B310 public override int GetMonth(DateTime time) { this.M_CheckDateTime(time); return CCGregorianCalendar.GetMonth(time); } /// Returns the number of months in the specified year in the specified era. /// The return value is always 12. /// An integer that represents the year. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013CE RID: 5070 RVA: 0x0004D120 File Offset: 0x0004B320 public override int GetMonthsInYear(int year, int era) { this.M_CheckYE(year, ref era); return 12; } /// Returns the week of the year that includes the date in the specified . /// A 1-based integer that represents the week of the year that includes the date in the parameter. /// The to read. /// One of the values that defines a calendar week. /// One of the values that represents the first day of the week. /// /// or is outside the range supported by the calendar.-or- is not a valid value. // Token: 0x060013CF RID: 5071 RVA: 0x0004D130 File Offset: 0x0004B330 [ComVisible(false)] public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) { return base.GetWeekOfYear(time, rule, firstDayOfWeek); } /// Returns the year in the specified . /// An integer that represents the year in the specified . /// The to read. // Token: 0x060013D0 RID: 5072 RVA: 0x0004D13C File Offset: 0x0004B33C public override int GetYear(DateTime time) { int num = CCFixed.FromDateTime(time); int num2; return JapaneseCalendar.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 to 12 that represents the month. /// An integer from 1 to 31 that represents the day. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013D1 RID: 5073 RVA: 0x0004D160 File Offset: 0x0004B360 public override bool IsLeapDay(int year, int month, int day, int era) { int num = this.M_CheckYMDEG(year, month, day, ref era); return CCGregorianCalendar.IsLeapDay(num, month, day); } /// Determines whether the specified month in the specified year in the specified era is a leap month. /// This method always returns false, unless overridden by a derived class. /// An integer that represents the year. /// An integer from 1 to 12 that represents the month. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013D2 RID: 5074 RVA: 0x0004D184 File Offset: 0x0004B384 public override bool IsLeapMonth(int year, int month, int era) { this.M_CheckYMEG(year, month, ref era); return false; } /// 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. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar. // Token: 0x060013D3 RID: 5075 RVA: 0x0004D194 File Offset: 0x0004B394 public override bool IsLeapYear(int year, int era) { int num = this.M_CheckYEG(year, ref era); return CCGregorianCalendar.is_leap_year(num); } /// Returns a that is set to the specified date and time in the specified era. /// The that is set to the specified date and time in the current era. /// An integer that represents the year. /// An integer from 1 to 12 that represents the month. /// An integer from 1 to 31 that represents the day. /// An integer from 0 to 23 that represents the hour. /// An integer from 0 to 59 that represents the minute. /// An integer from 0 to 59 that represents the second. /// An integer from 0 to 999 that represents the millisecond. /// An integer that represents the era. /// /// is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is outside the range supported by the calendar.-or- is less than zero or greater than 23.-or- is less than zero or greater than 59.-or- is less than zero or greater than 59.-or- is less than zero or greater than 999.-or- is outside the range supported by the calendar. // Token: 0x060013D4 RID: 5076 RVA: 0x0004D1B4 File Offset: 0x0004B3B4 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 by using the property to determine the appropriate century. /// An integer that contains the four-digit representation of . /// An integer (usually two digits) that represents the year to convert. /// /// is outside the range supported by the calendar. // Token: 0x060013D5 RID: 5077 RVA: 0x0004D1EC File Offset: 0x0004B3EC 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 the earliest date and time supported by the current object. /// The earliest date and time supported by the type, which is equivalent to the first moment of January 1, 1868 C.E. in the Gregorian calendar. // Token: 0x17000362 RID: 866 // (get) Token: 0x060013D6 RID: 5078 RVA: 0x0004D21C File Offset: 0x0004B41C [ComVisible(false)] public override DateTime MinSupportedDateTime { get { return JapaneseCalendar.JapanMin; } } /// Gets the latest date and time supported by the current object. /// The latest date and time supported by the type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. // Token: 0x17000363 RID: 867 // (get) Token: 0x060013D7 RID: 5079 RVA: 0x0004D224 File Offset: 0x0004B424 [ComVisible(false)] public override DateTime MaxSupportedDateTime { get { return JapaneseCalendar.JapanMax; } } // Token: 0x0400057C RID: 1404 internal static readonly CCGregorianEraHandler M_EraHandler = new CCGregorianEraHandler(); // Token: 0x0400057D RID: 1405 private static DateTime JapanMin = new DateTime(1868, 9, 8, 0, 0, 0); // Token: 0x0400057E RID: 1406 private static DateTime JapanMax = new DateTime(9999, 12, 31, 11, 59, 59); } }