scripts
This commit is contained in:
@@ -0,0 +1,743 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Globalization
|
||||
{
|
||||
/// <summary>Represents time in divisions, such as weeks, months, and years.</summary>
|
||||
// Token: 0x02000167 RID: 359
|
||||
[ComVisible(true)]
|
||||
[Serializable]
|
||||
public abstract class Calendar : ICloneable
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Globalization.Calendar" /> class.</summary>
|
||||
// Token: 0x0600117A RID: 4474 RVA: 0x00045A90 File Offset: 0x00043C90
|
||||
protected Calendar()
|
||||
{
|
||||
this.twoDigitYearMax = 99;
|
||||
}
|
||||
|
||||
// Token: 0x170002FB RID: 763
|
||||
// (get) Token: 0x0600117B RID: 4475 RVA: 0x00045AA0 File Offset: 0x00043CA0
|
||||
internal virtual int M_DaysInWeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600117C RID: 4476 RVA: 0x00045AA4 File Offset: 0x00043CA4
|
||||
internal string M_ValidValues(object a, object b)
|
||||
{
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
stringWriter.Write("Valid values are between {0} and {1}, inclusive.", a, b);
|
||||
return stringWriter.ToString();
|
||||
}
|
||||
|
||||
// Token: 0x0600117D RID: 4477 RVA: 0x00045ACC File Offset: 0x00043CCC
|
||||
internal void M_ArgumentInRange(string param, int arg, int a, int b)
|
||||
{
|
||||
if (a <= arg && arg <= b)
|
||||
{
|
||||
return;
|
||||
}
|
||||
throw new ArgumentOutOfRangeException(param, this.M_ValidValues(a, b));
|
||||
}
|
||||
|
||||
// Token: 0x0600117E RID: 4478 RVA: 0x00045AF8 File Offset: 0x00043CF8
|
||||
internal void M_CheckHMSM(int hour, int minute, int second, int milliseconds)
|
||||
{
|
||||
this.M_ArgumentInRange("hour", hour, 0, 23);
|
||||
this.M_ArgumentInRange("minute", minute, 0, 59);
|
||||
this.M_ArgumentInRange("second", second, 0, 59);
|
||||
this.M_ArgumentInRange("milliseconds", milliseconds, 0, 999999);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, gets the list of eras in the current calendar.</summary>
|
||||
/// <returns>An array of integers that represents the eras in the current calendar.</returns>
|
||||
// Token: 0x170002FC RID: 764
|
||||
// (get) Token: 0x0600117F RID: 4479
|
||||
public abstract int[] Eras { get; }
|
||||
|
||||
/// <summary>Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both.</summary>
|
||||
/// <returns>One of the <see cref="T:System.Globalization.CalendarAlgorithmType" /> values.</returns>
|
||||
// Token: 0x170002FD RID: 765
|
||||
// (get) Token: 0x06001180 RID: 4480 RVA: 0x00045B48 File Offset: 0x00043D48
|
||||
[ComVisible(false)]
|
||||
public virtual CalendarAlgorithmType AlgorithmType
|
||||
{
|
||||
get
|
||||
{
|
||||
return CalendarAlgorithmType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the latest date and time supported by this <see cref="T:System.Globalization.Calendar" /> object.</summary>
|
||||
/// <returns>The latest date and time supported by this calendar. The default is <see cref="F:System.DateTime.MaxValue" />.</returns>
|
||||
// Token: 0x170002FE RID: 766
|
||||
// (get) Token: 0x06001181 RID: 4481 RVA: 0x00045B4C File Offset: 0x00043D4C
|
||||
[ComVisible(false)]
|
||||
public virtual DateTime MaxSupportedDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return DateTime.MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the earliest date and time supported by this <see cref="T:System.Globalization.Calendar" /> object.</summary>
|
||||
/// <returns>The earliest date and time supported by this calendar. The default is <see cref="F:System.DateTime.MinValue" />.</returns>
|
||||
// Token: 0x170002FF RID: 767
|
||||
// (get) Token: 0x06001182 RID: 4482 RVA: 0x00045B54 File Offset: 0x00043D54
|
||||
[ComVisible(false)]
|
||||
public virtual DateTime MinSupportedDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Creates a new object that is a copy of the current <see cref="T:System.Globalization.Calendar" /> object.</summary>
|
||||
/// <returns>A new instance of <see cref="T:System.Object" /> that is the memberwise clone of the current <see cref="T:System.Globalization.Calendar" /> object.</returns>
|
||||
// Token: 0x06001183 RID: 4483 RVA: 0x00045B5C File Offset: 0x00043D5C
|
||||
[ComVisible(false)]
|
||||
public virtual object Clone()
|
||||
{
|
||||
Calendar calendar = (Calendar)base.MemberwiseClone();
|
||||
calendar.m_isReadOnly = false;
|
||||
return calendar;
|
||||
}
|
||||
|
||||
/// <summary>Calculates the leap month for a specified year.</summary>
|
||||
/// <returns>A positive integer that indicates the leap month in the specified year.-or-Zero if this calendar does not support a leap month or if the <paramref name="year" /> parameter does not represent a leap year.</returns>
|
||||
/// <param name="year">A year.</param>
|
||||
// Token: 0x06001184 RID: 4484 RVA: 0x00045B80 File Offset: 0x00043D80
|
||||
[ComVisible(false)]
|
||||
public virtual int GetLeapMonth(int year)
|
||||
{
|
||||
return this.GetLeapMonth(year, this.GetEra(this.ToDateTime(year, 1, 1, 0, 0, 0, 0)));
|
||||
}
|
||||
|
||||
/// <summary>Calculates the leap month for a specified year and era.</summary>
|
||||
/// <returns>A positive integer 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 <paramref name="year" /> and <paramref name="era" /> parameters do not specify a leap year.</returns>
|
||||
/// <param name="year">A year.</param>
|
||||
/// <param name="era">An era.</param>
|
||||
// Token: 0x06001185 RID: 4485 RVA: 0x00045BA8 File Offset: 0x00043DA8
|
||||
[ComVisible(false)]
|
||||
public virtual int GetLeapMonth(int year, int era)
|
||||
{
|
||||
int monthsInYear = this.GetMonthsInYear(year, era);
|
||||
for (int i = 1; i <= monthsInYear; i++)
|
||||
{
|
||||
if (this.IsLeapMonth(year, i, era))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether this <see cref="T:System.Globalization.Calendar" /> object is read-only.</summary>
|
||||
/// <returns>true if this <see cref="T:System.Globalization.Calendar" /> object is read-only; otherwise, false.</returns>
|
||||
// Token: 0x17000300 RID: 768
|
||||
// (get) Token: 0x06001186 RID: 4486 RVA: 0x00045BE4 File Offset: 0x00043DE4
|
||||
[ComVisible(false)]
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_isReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a read-only version of the specified <see cref="T:System.Globalization.Calendar" /> object.</summary>
|
||||
/// <returns>The <see cref="T:System.Globalization.Calendar" /> object specified by the <paramref name="calendar" /> parameter, if <paramref name="calendar" /> is read-only.-or-A read-only memberwise clone of the <see cref="T:System.Globalization.Calendar" /> object specified by <paramref name="calendar" />, if <paramref name="calendar" /> is not read-only.</returns>
|
||||
/// <param name="calendar">A <see cref="T:System.Globalization.Calendar" /> object.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="calendar" /> is null.</exception>
|
||||
// Token: 0x06001187 RID: 4487 RVA: 0x00045BEC File Offset: 0x00043DEC
|
||||
[ComVisible(false)]
|
||||
public static Calendar ReadOnly(Calendar calendar)
|
||||
{
|
||||
if (calendar.m_isReadOnly)
|
||||
{
|
||||
return calendar;
|
||||
}
|
||||
Calendar calendar2 = (Calendar)calendar.Clone();
|
||||
calendar2.m_isReadOnly = true;
|
||||
return calendar2;
|
||||
}
|
||||
|
||||
// Token: 0x06001188 RID: 4488 RVA: 0x00045C1C File Offset: 0x00043E1C
|
||||
internal void CheckReadOnly()
|
||||
{
|
||||
if (this.m_isReadOnly)
|
||||
{
|
||||
throw new InvalidOperationException("This Calendar is read-only.");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000301 RID: 769
|
||||
// (get) Token: 0x06001189 RID: 4489 RVA: 0x00045C34 File Offset: 0x00043E34
|
||||
internal virtual int M_MaxYear
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.M_MaxYearValue == 0)
|
||||
{
|
||||
this.M_MaxYearValue = this.GetYear(DateTime.MaxValue);
|
||||
}
|
||||
return this.M_MaxYearValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600118A RID: 4490 RVA: 0x00045C64 File Offset: 0x00043E64
|
||||
internal virtual void M_CheckYE(int year, ref int era)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.</summary>
|
||||
/// <returns>The last year of a 100-year range that can be represented by a 2-digit year.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The current <see cref="T:System.Globalization.Calendar" /> object is read-only.</exception>
|
||||
// Token: 0x17000302 RID: 770
|
||||
// (get) Token: 0x0600118B RID: 4491 RVA: 0x00045C68 File Offset: 0x00043E68
|
||||
// (set) Token: 0x0600118C RID: 4492 RVA: 0x00045C70 File Offset: 0x00043E70
|
||||
public virtual int TwoDigitYearMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.twoDigitYearMax;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.CheckReadOnly();
|
||||
this.M_ArgumentInRange("year", value, 100, this.M_MaxYear);
|
||||
int num = 0;
|
||||
this.M_CheckYE(value, ref num);
|
||||
this.twoDigitYearMax = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of days away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of days to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add days. </param>
|
||||
/// <param name="days">The number of days to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="days" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x0600118D RID: 4493 RVA: 0x00045CAC File Offset: 0x00043EAC
|
||||
public virtual DateTime AddDays(DateTime time, int days)
|
||||
{
|
||||
return time.Add(TimeSpan.FromDays((double)days));
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of hours away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of hours to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add hours. </param>
|
||||
/// <param name="hours">The number of hours to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="hours" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x0600118E RID: 4494 RVA: 0x00045CBC File Offset: 0x00043EBC
|
||||
public virtual DateTime AddHours(DateTime time, int hours)
|
||||
{
|
||||
return time.Add(TimeSpan.FromHours((double)hours));
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of milliseconds away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of milliseconds to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to add milliseconds to. </param>
|
||||
/// <param name="milliseconds">The number of milliseconds to add.</param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="milliseconds" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x0600118F RID: 4495 RVA: 0x00045CCC File Offset: 0x00043ECC
|
||||
public virtual DateTime AddMilliseconds(DateTime time, double milliseconds)
|
||||
{
|
||||
return time.Add(TimeSpan.FromMilliseconds(milliseconds));
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of minutes away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of minutes to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add minutes. </param>
|
||||
/// <param name="minutes">The number of minutes to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="minutes" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x06001190 RID: 4496 RVA: 0x00045CDC File Offset: 0x00043EDC
|
||||
public virtual DateTime AddMinutes(DateTime time, int minutes)
|
||||
{
|
||||
return time.Add(TimeSpan.FromMinutes((double)minutes));
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns a <see cref="T:System.DateTime" /> that is the specified number of months away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of months to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add months. </param>
|
||||
/// <param name="months">The number of months to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="months" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x06001191 RID: 4497
|
||||
public abstract DateTime AddMonths(DateTime time, int months);
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of seconds away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of seconds to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add seconds. </param>
|
||||
/// <param name="seconds">The number of seconds to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="seconds" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x06001192 RID: 4498 RVA: 0x00045CEC File Offset: 0x00043EEC
|
||||
public virtual DateTime AddSeconds(DateTime time, int seconds)
|
||||
{
|
||||
return time.Add(TimeSpan.FromSeconds((double)seconds));
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of weeks away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of weeks to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add weeks. </param>
|
||||
/// <param name="weeks">The number of weeks to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="weeks" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x06001193 RID: 4499 RVA: 0x00045CFC File Offset: 0x00043EFC
|
||||
public virtual DateTime AddWeeks(DateTime time, int weeks)
|
||||
{
|
||||
return time.AddDays((double)(weeks * this.M_DaysInWeek));
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns a <see cref="T:System.DateTime" /> that is the specified number of years away from the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of years to the specified <see cref="T:System.DateTime" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to which to add years. </param>
|
||||
/// <param name="years">The number of years to add. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range of this calendar. </exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="years" /> is outside the supported range of the <see cref="T:System.DateTime" /> return value. </exception>
|
||||
// Token: 0x06001194 RID: 4500
|
||||
public abstract DateTime AddYears(DateTime time, int years);
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the day of the month in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>A positive integer that represents the day of the month in the <paramref name="time" /> parameter.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x06001195 RID: 4501
|
||||
public abstract int GetDayOfMonth(DateTime time);
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the day of the week in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>A <see cref="T:System.DayOfWeek" /> value that represents the day of the week in the <paramref name="time" /> parameter.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x06001196 RID: 4502
|
||||
public abstract DayOfWeek GetDayOfWeek(DateTime time);
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the day of the year in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>A positive integer that represents the day of the year in the <paramref name="time" /> parameter.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x06001197 RID: 4503
|
||||
public abstract int GetDayOfYear(DateTime time);
|
||||
|
||||
/// <summary>Returns the number of days in the specified month and year of the current era.</summary>
|
||||
/// <returns>The number of days in the specified month in the specified year in the current era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x06001198 RID: 4504 RVA: 0x00045D10 File Offset: 0x00043F10
|
||||
public virtual int GetDaysInMonth(int year, int month)
|
||||
{
|
||||
return this.GetDaysInMonth(year, month, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the number of days in the specified month, year, and era.</summary>
|
||||
/// <returns>The number of days in the specified month in the specified year in the specified era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x06001199 RID: 4505
|
||||
public abstract int GetDaysInMonth(int year, int month, int era);
|
||||
|
||||
/// <summary>Returns the number of days in the specified year of the current era.</summary>
|
||||
/// <returns>The number of days in the specified year in the current era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x0600119A RID: 4506 RVA: 0x00045D1C File Offset: 0x00043F1C
|
||||
public virtual int GetDaysInYear(int year)
|
||||
{
|
||||
return this.GetDaysInYear(year, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the number of days in the specified year and era.</summary>
|
||||
/// <returns>The number of days in the specified year in the specified era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x0600119B RID: 4507
|
||||
public abstract int GetDaysInYear(int year, int era);
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the era in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>An integer that represents the era in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x0600119C RID: 4508
|
||||
public abstract int GetEra(DateTime time);
|
||||
|
||||
/// <summary>Returns the hours value in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>An integer from 0 to 23 that represents the hour in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x0600119D RID: 4509 RVA: 0x00045D28 File Offset: 0x00043F28
|
||||
public virtual int GetHour(DateTime time)
|
||||
{
|
||||
return time.TimeOfDay.Hours;
|
||||
}
|
||||
|
||||
/// <summary>Returns the milliseconds value in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>A double-precision floating-point number from 0 to 999 that represents the milliseconds in the <paramref name="time" /> parameter.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x0600119E RID: 4510 RVA: 0x00045D44 File Offset: 0x00043F44
|
||||
public virtual double GetMilliseconds(DateTime time)
|
||||
{
|
||||
return (double)time.TimeOfDay.Milliseconds;
|
||||
}
|
||||
|
||||
/// <summary>Returns the minutes value in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>An integer from 0 to 59 that represents the minutes in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x0600119F RID: 4511 RVA: 0x00045D64 File Offset: 0x00043F64
|
||||
public virtual int GetMinute(DateTime time)
|
||||
{
|
||||
return time.TimeOfDay.Minutes;
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the month in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>A positive integer that represents the month in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x060011A0 RID: 4512
|
||||
public abstract int GetMonth(DateTime time);
|
||||
|
||||
/// <summary>Returns the number of months in the specified year in the current era.</summary>
|
||||
/// <returns>The number of months in the specified year in the current era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011A1 RID: 4513 RVA: 0x00045D80 File Offset: 0x00043F80
|
||||
public virtual int GetMonthsInYear(int year)
|
||||
{
|
||||
return this.GetMonthsInYear(year, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the number of months in the specified year in the specified era.</summary>
|
||||
/// <returns>The number of months in the specified year in the specified era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011A2 RID: 4514
|
||||
public abstract int GetMonthsInYear(int year, int era);
|
||||
|
||||
/// <summary>Returns the seconds value in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>An integer from 0 to 59 that represents the seconds in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x060011A3 RID: 4515 RVA: 0x00045D8C File Offset: 0x00043F8C
|
||||
public virtual int GetSecond(DateTime time)
|
||||
{
|
||||
return time.TimeOfDay.Seconds;
|
||||
}
|
||||
|
||||
// Token: 0x060011A4 RID: 4516 RVA: 0x00045DA8 File Offset: 0x00043FA8
|
||||
internal int M_DiffDays(DateTime timeA, DateTime timeB)
|
||||
{
|
||||
long num = timeA.Ticks - timeB.Ticks;
|
||||
if (num >= 0L)
|
||||
{
|
||||
return (int)(num / 864000000000L);
|
||||
}
|
||||
num += 1L;
|
||||
return -1 + (int)(num / 864000000000L);
|
||||
}
|
||||
|
||||
// Token: 0x060011A5 RID: 4517 RVA: 0x00045DF0 File Offset: 0x00043FF0
|
||||
internal DateTime M_GetFirstDayOfSecondWeekOfYear(int year, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
|
||||
{
|
||||
DateTime dateTime = this.ToDateTime(year, 1, 1, 0, 0, 0, 0);
|
||||
int dayOfWeek = (int)this.GetDayOfWeek(dateTime);
|
||||
int num = 0;
|
||||
switch (rule)
|
||||
{
|
||||
case CalendarWeekRule.FirstDay:
|
||||
if (firstDayOfWeek > (DayOfWeek)dayOfWeek)
|
||||
{
|
||||
num += firstDayOfWeek - (DayOfWeek)dayOfWeek;
|
||||
}
|
||||
else
|
||||
{
|
||||
num += firstDayOfWeek + this.M_DaysInWeek - (DayOfWeek)dayOfWeek;
|
||||
}
|
||||
break;
|
||||
case CalendarWeekRule.FirstFullWeek:
|
||||
num = this.M_DaysInWeek;
|
||||
if (firstDayOfWeek >= (DayOfWeek)dayOfWeek)
|
||||
{
|
||||
num += firstDayOfWeek - (DayOfWeek)dayOfWeek;
|
||||
}
|
||||
else
|
||||
{
|
||||
num += firstDayOfWeek + this.M_DaysInWeek - (DayOfWeek)dayOfWeek;
|
||||
}
|
||||
break;
|
||||
case CalendarWeekRule.FirstFourDayWeek:
|
||||
{
|
||||
int num2 = (dayOfWeek + 3) % this.M_DaysInWeek;
|
||||
num = 3;
|
||||
if (firstDayOfWeek > (DayOfWeek)num2)
|
||||
{
|
||||
num += firstDayOfWeek - (DayOfWeek)num2;
|
||||
}
|
||||
else
|
||||
{
|
||||
num += firstDayOfWeek + this.M_DaysInWeek - (DayOfWeek)num2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.AddDays(dateTime, num);
|
||||
}
|
||||
|
||||
/// <summary>Returns the week of the year that includes the date in the specified <see cref="T:System.DateTime" /> value.</summary>
|
||||
/// <returns>A positive integer that represents the week of the year that includes the date in the <paramref name="time" /> parameter.</returns>
|
||||
/// <param name="time">A date and time value.</param>
|
||||
/// <param name="rule">An enumeration value that defines a calendar week. </param>
|
||||
/// <param name="firstDayOfWeek">An enumeration value that represents the first day of the week. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="time" /> is earlier than <see cref="P:System.Globalization.Calendar.MinSupportedDateTime" /> or later than <see cref="P:System.Globalization.Calendar.MaxSupportedDateTime" />.-or-<paramref name="firstDayOfWeek" /> is not a valid <see cref="T:System.DayOfWeek" /> value.-or- <paramref name="rule" /> is not a valid <see cref="T:System.Globalization.CalendarWeekRule" /> value. </exception>
|
||||
// Token: 0x060011A6 RID: 4518 RVA: 0x00045EC0 File Offset: 0x000440C0
|
||||
public virtual int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
|
||||
{
|
||||
if (firstDayOfWeek < DayOfWeek.Sunday || DayOfWeek.Saturday < firstDayOfWeek)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("firstDayOfWeek", "Value is not a valid day of week.");
|
||||
}
|
||||
int num = this.GetYear(time);
|
||||
int num2;
|
||||
for (;;)
|
||||
{
|
||||
DateTime dateTime = this.M_GetFirstDayOfSecondWeekOfYear(num, rule, firstDayOfWeek);
|
||||
num2 = this.M_DiffDays(time, dateTime) + this.M_DaysInWeek;
|
||||
if (num2 >= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
return 1 + num2 / this.M_DaysInWeek;
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns the year in the specified <see cref="T:System.DateTime" />.</summary>
|
||||
/// <returns>An integer that represents the year in <paramref name="time" />.</returns>
|
||||
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
||||
// Token: 0x060011A7 RID: 4519
|
||||
public abstract int GetYear(DateTime time);
|
||||
|
||||
/// <summary>Determines whether the specified date in the current era is a leap day.</summary>
|
||||
/// <returns>true if the specified day is a leap day; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="day">A positive integer that represents the day. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011A8 RID: 4520 RVA: 0x00045F2C File Offset: 0x0004412C
|
||||
public virtual bool IsLeapDay(int year, int month, int day)
|
||||
{
|
||||
return this.IsLeapDay(year, month, day, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, determines whether the specified date in the specified era is a leap day.</summary>
|
||||
/// <returns>true if the specified day is a leap day; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="day">A positive integer that represents the day. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011A9 RID: 4521
|
||||
public abstract bool IsLeapDay(int year, int month, int day, int era);
|
||||
|
||||
/// <summary>Determines whether the specified month in the specified year in the current era is a leap month.</summary>
|
||||
/// <returns>true if the specified month is a leap month; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011AA RID: 4522 RVA: 0x00045F38 File Offset: 0x00044138
|
||||
public virtual bool IsLeapMonth(int year, int month)
|
||||
{
|
||||
return this.IsLeapMonth(year, month, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, determines whether the specified month in the specified year in the specified era is a leap month.</summary>
|
||||
/// <returns>true if the specified month is a leap month; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011AB RID: 4523
|
||||
public abstract bool IsLeapMonth(int year, int month, int era);
|
||||
|
||||
/// <summary>Determines whether the specified year in the current era is a leap year.</summary>
|
||||
/// <returns>true if the specified year is a leap year; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011AC RID: 4524 RVA: 0x00045F44 File Offset: 0x00044144
|
||||
public virtual bool IsLeapYear(int year)
|
||||
{
|
||||
return this.IsLeapYear(year, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, determines whether the specified year in the specified era is a leap year.</summary>
|
||||
/// <returns>true if the specified year is a leap year; otherwise, false.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011AD RID: 4525
|
||||
public abstract bool IsLeapYear(int year, int era);
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="day">A positive integer that represents the day. </param>
|
||||
/// <param name="hour">An integer from 0 to 23 that represents the hour. </param>
|
||||
/// <param name="minute">An integer from 0 to 59 that represents the minute. </param>
|
||||
/// <param name="second">An integer from 0 to 59 that represents the second. </param>
|
||||
/// <param name="millisecond">An integer from 0 to 999 that represents the millisecond. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar.-or- <paramref name="hour" /> is less than zero or greater than 23.-or- <paramref name="minute" /> is less than zero or greater than 59.-or- <paramref name="second" /> is less than zero or greater than 59.-or- <paramref name="millisecond" /> is less than zero or greater than 999. </exception>
|
||||
// Token: 0x060011AE RID: 4526 RVA: 0x00045F50 File Offset: 0x00044150
|
||||
public virtual DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)
|
||||
{
|
||||
return this.ToDateTime(year, month, day, hour, minute, second, millisecond, 0);
|
||||
}
|
||||
|
||||
/// <summary>When overridden in a derived class, returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the specified era.</summary>
|
||||
/// <returns>The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</returns>
|
||||
/// <param name="year">An integer that represents the year. </param>
|
||||
/// <param name="month">A positive integer that represents the month. </param>
|
||||
/// <param name="day">A positive integer that represents the day. </param>
|
||||
/// <param name="hour">An integer from 0 to 23 that represents the hour. </param>
|
||||
/// <param name="minute">An integer from 0 to 59 that represents the minute. </param>
|
||||
/// <param name="second">An integer from 0 to 59 that represents the second. </param>
|
||||
/// <param name="millisecond">An integer from 0 to 999 that represents the millisecond. </param>
|
||||
/// <param name="era">An integer that represents the era. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar.-or- <paramref name="hour" /> is less than zero or greater than 23.-or- <paramref name="minute" /> is less than zero or greater than 59.-or- <paramref name="second" /> is less than zero or greater than 59.-or- <paramref name="millisecond" /> is less than zero or greater than 999.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011AF RID: 4527
|
||||
public abstract DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
|
||||
|
||||
/// <summary>Converts the specified year to a four-digit year by using the <see cref="P:System.Globalization.Calendar.TwoDigitYearMax" /> property to determine the appropriate century.</summary>
|
||||
/// <returns>An integer that contains the four-digit representation of <paramref name="year" />.</returns>
|
||||
/// <param name="year">A two-digit or four-digit integer that represents the year to convert. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="year" /> is outside the range supported by the calendar. </exception>
|
||||
// Token: 0x060011B0 RID: 4528 RVA: 0x00045F70 File Offset: 0x00044170
|
||||
public virtual int ToFourDigitYear(int year)
|
||||
{
|
||||
if (year < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("year", "Non-negative number required.");
|
||||
}
|
||||
if (year <= 99)
|
||||
{
|
||||
int num = this.TwoDigitYearMax % 100;
|
||||
int num2 = year - num;
|
||||
year = this.TwoDigitYearMax + num2 + ((num2 > 0) ? (-100) : 0);
|
||||
}
|
||||
int num3 = 0;
|
||||
this.M_CheckYE(year, ref num3);
|
||||
return year;
|
||||
}
|
||||
|
||||
// Token: 0x17000303 RID: 771
|
||||
// (get) Token: 0x060011B1 RID: 4529 RVA: 0x00045FD0 File Offset: 0x000441D0
|
||||
// (set) Token: 0x060011B2 RID: 4530 RVA: 0x00046010 File Offset: 0x00044210
|
||||
internal string[] AbbreviatedEraNames
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.M_AbbrEraNames == null || this.M_AbbrEraNames.Length != this.Eras.Length)
|
||||
{
|
||||
throw new Exception("Internal: M_AbbrEraNames wrong initialized!");
|
||||
}
|
||||
return (string[])this.M_AbbrEraNames.Clone();
|
||||
}
|
||||
set
|
||||
{
|
||||
this.CheckReadOnly();
|
||||
if (value.Length != this.Eras.Length)
|
||||
{
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
stringWriter.Write("Array length must be equal Eras length {0}.", this.Eras.Length);
|
||||
throw new ArgumentException(stringWriter.ToString());
|
||||
}
|
||||
this.M_AbbrEraNames = (string[])value.Clone();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000304 RID: 772
|
||||
// (get) Token: 0x060011B3 RID: 4531 RVA: 0x00046070 File Offset: 0x00044270
|
||||
// (set) Token: 0x060011B4 RID: 4532 RVA: 0x000460B0 File Offset: 0x000442B0
|
||||
internal string[] EraNames
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.M_EraNames == null || this.M_EraNames.Length != this.Eras.Length)
|
||||
{
|
||||
throw new Exception("Internal: M_EraNames not initialized!");
|
||||
}
|
||||
return (string[])this.M_EraNames.Clone();
|
||||
}
|
||||
set
|
||||
{
|
||||
this.CheckReadOnly();
|
||||
if (value.Length != this.Eras.Length)
|
||||
{
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
stringWriter.Write("Array length must be equal Eras length {0}.", this.Eras.Length);
|
||||
throw new ArgumentException(stringWriter.ToString());
|
||||
}
|
||||
this.M_EraNames = (string[])value.Clone();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Represents the current era of the current calendar. </summary>
|
||||
// Token: 0x0400045F RID: 1119
|
||||
public const int CurrentEra = 0;
|
||||
|
||||
// Token: 0x04000460 RID: 1120
|
||||
[NonSerialized]
|
||||
private bool m_isReadOnly;
|
||||
|
||||
// Token: 0x04000461 RID: 1121
|
||||
[NonSerialized]
|
||||
internal int twoDigitYearMax;
|
||||
|
||||
// Token: 0x04000462 RID: 1122
|
||||
[NonSerialized]
|
||||
private int M_MaxYearValue;
|
||||
|
||||
// Token: 0x04000463 RID: 1123
|
||||
[NonSerialized]
|
||||
internal string[] M_AbbrEraNames;
|
||||
|
||||
// Token: 0x04000464 RID: 1124
|
||||
[NonSerialized]
|
||||
internal string[] M_EraNames;
|
||||
|
||||
// Token: 0x04000465 RID: 1125
|
||||
internal int m_currentEraValue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user