using System;
using System.Runtime.InteropServices;
namespace System.Globalization
{
/// Represents the Korean calendar.
// Token: 0x02000190 RID: 400
[MonoTODO("Serialization format not compatible with .NET")]
[ComVisible(true)]
[Serializable]
public class KoreanCalendar : Calendar
{
/// Initializes a new instance of the class.
// Token: 0x060013FC RID: 5116 RVA: 0x0004D71C File Offset: 0x0004B91C
public KoreanCalendar()
{
this.M_AbbrEraNames = new string[] { "K.C.E." };
this.M_EraNames = new string[] { "Korean Current Era" };
if (this.twoDigitYearMax == 99)
{
this.twoDigitYearMax = 4362;
}
}
// Token: 0x060013FD RID: 5117 RVA: 0x0004D770 File Offset: 0x0004B970
static KoreanCalendar()
{
KoreanCalendar.M_EraHandler.appendEra(1, CCGregorianCalendar.fixed_from_dmy(1, 1, -2332));
}
/// Gets the list of eras in the .
/// An array of integers that represents the eras in the .
// Token: 0x1700036D RID: 877
// (get) Token: 0x060013FE RID: 5118 RVA: 0x0004D7C8 File Offset: 0x0004B9C8
public override int[] Eras
{
get
{
return (int[])KoreanCalendar.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: 0x1700036E RID: 878
// (get) Token: 0x060013FF RID: 5119 RVA: 0x0004D7E0 File Offset: 0x0004B9E0
// (set) Token: 0x06001400 RID: 5120 RVA: 0x0004D7E8 File Offset: 0x0004B9E8
public override int TwoDigitYearMax
{
get
{
return this.twoDigitYearMax;
}
set
{
base.CheckReadOnly();
base.M_ArgumentInRange("value", value, 100, this.M_MaxYear);
this.twoDigitYearMax = value;
}
}
// Token: 0x06001401 RID: 5121 RVA: 0x0004D818 File Offset: 0x0004BA18
internal void M_CheckEra(ref int era)
{
if (era == 0)
{
era = 1;
}
if (!KoreanCalendar.M_EraHandler.ValidEra(era))
{
throw new ArgumentException("Era value was not valid.");
}
}
// Token: 0x06001402 RID: 5122 RVA: 0x0004D84C File Offset: 0x0004BA4C
internal int M_CheckYEG(int year, ref int era)
{
this.M_CheckEra(ref era);
return KoreanCalendar.M_EraHandler.GregorianYear(year, era);
}
// Token: 0x06001403 RID: 5123 RVA: 0x0004D864 File Offset: 0x0004BA64
internal override void M_CheckYE(int year, ref int era)
{
this.M_CheckYEG(year, ref era);
}
// Token: 0x06001404 RID: 5124 RVA: 0x0004D870 File Offset: 0x0004BA70
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: 0x06001405 RID: 5125 RVA: 0x0004D8A8 File Offset: 0x0004BAA8
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.
///
/// is less than -120000.-or- is greater than 120000.
// Token: 0x06001406 RID: 5126 RVA: 0x0004D8DC File Offset: 0x0004BADC
public override DateTime AddMonths(DateTime time, int months)
{
return CCGregorianCalendar.AddMonths(time, months);
}
/// 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.
///
/// or is out of range.
// Token: 0x06001407 RID: 5127 RVA: 0x0004D8E8 File Offset: 0x0004BAE8
public override DateTime AddYears(DateTime time, int years)
{
return CCGregorianCalendar.AddYears(time, years);
}
/// 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: 0x06001408 RID: 5128 RVA: 0x0004D8F4 File Offset: 0x0004BAF4
public override int GetDayOfMonth(DateTime 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: 0x06001409 RID: 5129 RVA: 0x0004D8FC File Offset: 0x0004BAFC
public override DayOfWeek GetDayOfWeek(DateTime 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: 0x0600140A RID: 5130 RVA: 0x0004D918 File Offset: 0x0004BB18
public override int GetDayOfYear(DateTime 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: 0x0600140B RID: 5131 RVA: 0x0004D920 File Offset: 0x0004BB20
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: 0x0600140C RID: 5132 RVA: 0x0004D940 File Offset: 0x0004BB40
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.
// Token: 0x0600140D RID: 5133 RVA: 0x0004D960 File Offset: 0x0004BB60
public override int GetEra(DateTime time)
{
int num = CCFixed.FromDateTime(time);
int num2;
KoreanCalendar.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 class does not support the notion of a leap month.
/// A year.
/// An era.
// Token: 0x0600140E RID: 5134 RVA: 0x0004D984 File Offset: 0x0004BB84
[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: 0x0600140F RID: 5135 RVA: 0x0004D988 File Offset: 0x0004BB88
public override int GetMonth(DateTime time)
{
return CCGregorianCalendar.GetMonth(time);
}
/// Returns the number of months in the specified year in the specified era.
/// The number of months 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: 0x06001410 RID: 5136 RVA: 0x0004D990 File Offset: 0x0004BB90
public override int GetMonthsInYear(int year, int era)
{
this.M_CheckYEG(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: 0x06001411 RID: 5137 RVA: 0x0004D9A0 File Offset: 0x0004BBA0
[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: 0x06001412 RID: 5138 RVA: 0x0004D9AC File Offset: 0x0004BBAC
public override int GetYear(DateTime time)
{
int num = CCFixed.FromDateTime(time);
int num2;
return KoreanCalendar.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: 0x06001413 RID: 5139 RVA: 0x0004D9D0 File Offset: 0x0004BBD0
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: 0x06001414 RID: 5140 RVA: 0x0004D9F4 File Offset: 0x0004BBF4
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: 0x06001415 RID: 5141 RVA: 0x0004DA04 File Offset: 0x0004BC04
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: 0x06001416 RID: 5142 RVA: 0x0004DA24 File Offset: 0x0004BC24
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 .
/// A two-digit or four-digit integer that represents the year to convert.
///
/// is outside the range supported by the calendar.
///
///
///
// Token: 0x06001417 RID: 5143 RVA: 0x0004DA5C File Offset: 0x0004BC5C
public override int ToFourDigitYear(int year)
{
return base.ToFourDigitYear(year);
}
/// Gets the earliest date and time supported by the class.
/// The earliest date and time supported by the class, which is equivalent to the first moment of January 1, 0001 C.E. in the Gregorian calendar.
// Token: 0x1700036F RID: 879
// (get) Token: 0x06001418 RID: 5144 RVA: 0x0004DA68 File Offset: 0x0004BC68
[ComVisible(false)]
public override DateTime MinSupportedDateTime
{
get
{
return KoreanCalendar.KoreanMin;
}
}
/// Gets the latest date and time supported by the class.
/// The latest date and time supported by the class, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar.
// Token: 0x17000370 RID: 880
// (get) Token: 0x06001419 RID: 5145 RVA: 0x0004DA70 File Offset: 0x0004BC70
[ComVisible(false)]
public override DateTime MaxSupportedDateTime
{
get
{
return KoreanCalendar.KoreanMax;
}
}
/// Represents the current era. This field is constant.
// Token: 0x04000586 RID: 1414
public const int KoreanEra = 1;
// Token: 0x04000587 RID: 1415
internal static readonly CCGregorianEraHandler M_EraHandler = new CCGregorianEraHandler();
// Token: 0x04000588 RID: 1416
private static DateTime KoreanMin = new DateTime(1, 1, 1, 0, 0, 0);
// Token: 0x04000589 RID: 1417
private static DateTime KoreanMax = new DateTime(9999, 12, 31, 11, 59, 59);
}
}