506 lines
25 KiB
C#
506 lines
25 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Globalization
|
|
{
|
|
/// <summary>Represents the Hijri calendar.</summary>
|
|
// Token: 0x02000189 RID: 393
|
|
[ComVisible(true)]
|
|
[MonoTODO("Serialization format not compatible with .NET")]
|
|
[Serializable]
|
|
public class HijriCalendar : Calendar
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Globalization.HijriCalendar" /> class.</summary>
|
|
// Token: 0x06001379 RID: 4985 RVA: 0x0004BAC4 File Offset: 0x00049CC4
|
|
public HijriCalendar()
|
|
{
|
|
this.M_AbbrEraNames = new string[] { "A.H." };
|
|
this.M_EraNames = new string[] { "Anno Hegirae" };
|
|
if (this.twoDigitYearMax == 99)
|
|
{
|
|
this.twoDigitYearMax = 1451;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the list of eras in the <see cref="T:System.Globalization.HijriCalendar" />.</summary>
|
|
/// <returns>An array of integers that represents the eras in the <see cref="T:System.Globalization.HijriCalendar" />.</returns>
|
|
// Token: 0x17000358 RID: 856
|
|
// (get) Token: 0x0600137B RID: 4987 RVA: 0x0004BB7C File Offset: 0x00049D7C
|
|
public override int[] Eras
|
|
{
|
|
get
|
|
{
|
|
return new int[] { HijriCalendar.HijriEra };
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the number of days to add or subtract from the calendar to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions.</summary>
|
|
/// <returns>An integer from -2 to 2 that represents the number of days to add or subtract from the calendar.</returns>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to an invalid value. </exception>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000359 RID: 857
|
|
// (get) Token: 0x0600137C RID: 4988 RVA: 0x0004BB8C File Offset: 0x00049D8C
|
|
// (set) Token: 0x0600137D RID: 4989 RVA: 0x0004BB94 File Offset: 0x00049D94
|
|
[MonoTODO("Not supported")]
|
|
public int HijriAdjustment
|
|
{
|
|
get
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
set
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
/// <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">This calendar is read-only.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The value in a set operation is less than 100 or greater than 9666.</exception>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700035A RID: 858
|
|
// (get) Token: 0x0600137E RID: 4990 RVA: 0x0004BB9C File Offset: 0x00049D9C
|
|
// (set) Token: 0x0600137F RID: 4991 RVA: 0x0004BBA4 File Offset: 0x00049DA4
|
|
public override int TwoDigitYearMax
|
|
{
|
|
get
|
|
{
|
|
return this.twoDigitYearMax;
|
|
}
|
|
set
|
|
{
|
|
base.CheckReadOnly();
|
|
base.M_ArgumentInRange("value", value, 100, this.M_MaxYear);
|
|
this.twoDigitYearMax = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700035B RID: 859
|
|
// (get) Token: 0x06001380 RID: 4992 RVA: 0x0004BBD4 File Offset: 0x00049DD4
|
|
// (set) Token: 0x06001381 RID: 4993 RVA: 0x0004BBDC File Offset: 0x00049DDC
|
|
internal virtual int AddHijriDate
|
|
{
|
|
get
|
|
{
|
|
return this.M_AddHijriDate;
|
|
}
|
|
set
|
|
{
|
|
base.CheckReadOnly();
|
|
if (value < -3 && value > 3)
|
|
{
|
|
throw new ArgumentOutOfRangeException("AddHijriDate", "Value should be between -3 and 3.");
|
|
}
|
|
this.M_AddHijriDate = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001382 RID: 4994 RVA: 0x0004BC18 File Offset: 0x00049E18
|
|
internal void M_CheckFixedHijri(string param, int rdHijri)
|
|
{
|
|
if (rdHijri < HijriCalendar.M_MinFixed || rdHijri > HijriCalendar.M_MaxFixed - this.AddHijriDate)
|
|
{
|
|
StringWriter stringWriter = new StringWriter();
|
|
int num;
|
|
int num2;
|
|
int num3;
|
|
CCHijriCalendar.dmy_from_fixed(out num, out num2, out num3, HijriCalendar.M_MaxFixed - this.AddHijriDate);
|
|
if (this.AddHijriDate != 0)
|
|
{
|
|
stringWriter.Write("This HijriCalendar (AddHijriDate {0}) allows dates from 1. 1. 1 to {1}. {2}. {3}.", new object[] { this.AddHijriDate, num, num2, num3 });
|
|
}
|
|
else
|
|
{
|
|
stringWriter.Write("HijriCalendar allows dates from 1.1.1 to {0}.{1}.{2}.", num, num2, num3);
|
|
}
|
|
throw new ArgumentOutOfRangeException(param, stringWriter.ToString());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001383 RID: 4995 RVA: 0x0004BCD4 File Offset: 0x00049ED4
|
|
internal void M_CheckDateTime(DateTime time)
|
|
{
|
|
int num = CCFixed.FromDateTime(time) - this.AddHijriDate;
|
|
this.M_CheckFixedHijri("time", num);
|
|
}
|
|
|
|
// Token: 0x06001384 RID: 4996 RVA: 0x0004BCFC File Offset: 0x00049EFC
|
|
internal int M_FromDateTime(DateTime time)
|
|
{
|
|
return CCFixed.FromDateTime(time) - this.AddHijriDate;
|
|
}
|
|
|
|
// Token: 0x06001385 RID: 4997 RVA: 0x0004BD0C File Offset: 0x00049F0C
|
|
internal DateTime M_ToDateTime(int rd)
|
|
{
|
|
return CCFixed.ToDateTime(rd + this.AddHijriDate);
|
|
}
|
|
|
|
// Token: 0x06001386 RID: 4998 RVA: 0x0004BD1C File Offset: 0x00049F1C
|
|
internal DateTime M_ToDateTime(int date, int hour, int minute, int second, int milliseconds)
|
|
{
|
|
return CCFixed.ToDateTime(date + this.AddHijriDate, hour, minute, second, (double)milliseconds);
|
|
}
|
|
|
|
// Token: 0x06001387 RID: 4999 RVA: 0x0004BD34 File Offset: 0x00049F34
|
|
internal void M_CheckEra(ref int era)
|
|
{
|
|
if (era == 0)
|
|
{
|
|
era = HijriCalendar.HijriEra;
|
|
}
|
|
if (era != HijriCalendar.HijriEra)
|
|
{
|
|
throw new ArgumentException("Era value was not valid.");
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001388 RID: 5000 RVA: 0x0004BD5C File Offset: 0x00049F5C
|
|
internal override void M_CheckYE(int year, ref int era)
|
|
{
|
|
this.M_CheckEra(ref era);
|
|
base.M_ArgumentInRange("year", year, 1, 9666);
|
|
}
|
|
|
|
// Token: 0x06001389 RID: 5001 RVA: 0x0004BD84 File Offset: 0x00049F84
|
|
internal void M_CheckYME(int year, int month, ref int era)
|
|
{
|
|
this.M_CheckYE(year, ref era);
|
|
if (month < 1 || month > 12)
|
|
{
|
|
throw new ArgumentOutOfRangeException("month", "Month must be between one and twelve.");
|
|
}
|
|
if (year == 9666)
|
|
{
|
|
int num = CCHijriCalendar.fixed_from_dmy(1, month, year);
|
|
this.M_CheckFixedHijri("month", num);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600138A RID: 5002 RVA: 0x0004BDD8 File Offset: 0x00049FD8
|
|
internal void M_CheckYMDE(int year, int month, int day, ref int era)
|
|
{
|
|
this.M_CheckYME(year, month, ref era);
|
|
base.M_ArgumentInRange("day", day, 1, this.GetDaysInMonth(year, month, HijriCalendar.HijriEra));
|
|
if (year == 9666)
|
|
{
|
|
int num = CCHijriCalendar.fixed_from_dmy(day, month, year);
|
|
this.M_CheckFixedHijri("day", num);
|
|
}
|
|
}
|
|
|
|
/// <summary>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 add months to. </param>
|
|
/// <param name="months">The number of months to add. </param>
|
|
/// <exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" />.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="months" /> is less than -120000.-or- <paramref name="months" /> is greater than 120000. </exception>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600138B RID: 5003 RVA: 0x0004BE2C File Offset: 0x0004A02C
|
|
public override DateTime AddMonths(DateTime time, int months)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
int num2;
|
|
int num3;
|
|
int num4;
|
|
CCHijriCalendar.dmy_from_fixed(out num2, out num3, out num4, num);
|
|
num3 += months;
|
|
num4 += CCMath.div_mod(out num3, num3, 12);
|
|
num = CCHijriCalendar.fixed_from_dmy(num2, num3, num4);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return this.M_ToDateTime(num).Add(time.TimeOfDay);
|
|
}
|
|
|
|
/// <summary>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 add years to. </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. </exception>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600138C RID: 5004 RVA: 0x0004BE8C File Offset: 0x0004A08C
|
|
public override DateTime AddYears(DateTime time, int years)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
int num2;
|
|
int num3;
|
|
int num4;
|
|
CCHijriCalendar.dmy_from_fixed(out num2, out num3, out num4, num);
|
|
num4 += years;
|
|
num = CCHijriCalendar.fixed_from_dmy(num2, num3, num4);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return this.M_ToDateTime(num).Add(time.TimeOfDay);
|
|
}
|
|
|
|
/// <summary>Returns the day of the month in the specified <see cref="T:System.DateTime" />.</summary>
|
|
/// <returns>An integer from 1 to 30 that represents the day of the month in the specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600138D RID: 5005 RVA: 0x0004BEE0 File Offset: 0x0004A0E0
|
|
public override int GetDayOfMonth(DateTime time)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return CCHijriCalendar.day_from_fixed(num);
|
|
}
|
|
|
|
/// <summary>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 specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
// Token: 0x0600138E RID: 5006 RVA: 0x0004BF08 File Offset: 0x0004A108
|
|
public override DayOfWeek GetDayOfWeek(DateTime time)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return CCFixed.day_of_week(num);
|
|
}
|
|
|
|
/// <summary>Returns the day of the year in the specified <see cref="T:System.DateTime" />.</summary>
|
|
/// <returns>An integer from 1 to 355 that represents the day of the year in the specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600138F RID: 5007 RVA: 0x0004BF30 File Offset: 0x0004A130
|
|
public override int GetDayOfYear(DateTime time)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
this.M_CheckFixedHijri("time", num);
|
|
int num2 = CCHijriCalendar.year_from_fixed(num);
|
|
int num3 = CCHijriCalendar.fixed_from_dmy(1, 1, num2);
|
|
return num - num3 + 1;
|
|
}
|
|
|
|
/// <summary>Returns the number of days in the specified month of the specified 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">An integer from 1 to 12 that represents the month. </param>
|
|
/// <param name="era">An integer that represents the era. </param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar.-or- <paramref name="month" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001390 RID: 5008 RVA: 0x0004BF68 File Offset: 0x0004A168
|
|
public override int GetDaysInMonth(int year, int month, int era)
|
|
{
|
|
this.M_CheckYME(year, month, ref era);
|
|
int num = CCHijriCalendar.fixed_from_dmy(1, month, year);
|
|
int num2 = CCHijriCalendar.fixed_from_dmy(1, month + 1, year);
|
|
return num2 - num;
|
|
}
|
|
|
|
/// <summary>Returns the number of days in the specified year and era.</summary>
|
|
/// <returns>The number of days in the specified year and era. The number of days is 354 in a common year or 355 in a leap year.</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" /> or <paramref name="era" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001391 RID: 5009 RVA: 0x0004BF98 File Offset: 0x0004A198
|
|
public override int GetDaysInYear(int year, int era)
|
|
{
|
|
this.M_CheckYE(year, ref era);
|
|
int num = CCHijriCalendar.fixed_from_dmy(1, 1, year);
|
|
int num2 = CCHijriCalendar.fixed_from_dmy(1, 1, year + 1);
|
|
return num2 - num;
|
|
}
|
|
|
|
/// <summary>Returns the era in the specified <see cref="T:System.DateTime" />.</summary>
|
|
/// <returns>An integer that represents the era in the specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
// Token: 0x06001392 RID: 5010 RVA: 0x0004BFC8 File Offset: 0x0004A1C8
|
|
public override int GetEra(DateTime time)
|
|
{
|
|
this.M_CheckDateTime(time);
|
|
return HijriCalendar.HijriEra;
|
|
}
|
|
|
|
/// <summary>Calculates the leap month for a specified year and era.</summary>
|
|
/// <returns>Always 0 because the <see cref="T:System.Globalization.HijriCalendar" /> type does not support the notion of a leap month.</returns>
|
|
/// <param name="year">A year.</param>
|
|
/// <param name="era">An era. Specify <see cref="F:System.Globalization.Calendar.CurrentEra" /> or <see cref="F:System.Globalization.HijriCalendar.HijriEra" />.</param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="year" /> is less than the Hijri calendar year 1 or greater than the year 9666.-or-<paramref name="era" /> is not <see cref="F:System.Globalization.Calendar.CurrentEra" /> or <see cref="F:System.Globalization.HijriCalendar.HijriEra" />.</exception>
|
|
// Token: 0x06001393 RID: 5011 RVA: 0x0004BFD8 File Offset: 0x0004A1D8
|
|
[ComVisible(false)]
|
|
public override int GetLeapMonth(int year, int era)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/// <summary>Returns the month in the specified <see cref="T:System.DateTime" />.</summary>
|
|
/// <returns>An integer from 1 to 12 that represents the month in the specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06001394 RID: 5012 RVA: 0x0004BFDC File Offset: 0x0004A1DC
|
|
public override int GetMonth(DateTime time)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return CCHijriCalendar.month_from_fixed(num);
|
|
}
|
|
|
|
/// <summary>Returns the number of months in the specified year and era.</summary>
|
|
/// <returns>The number of months in the specified year and 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="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001395 RID: 5013 RVA: 0x0004C004 File Offset: 0x0004A204
|
|
public override int GetMonthsInYear(int year, int era)
|
|
{
|
|
this.M_CheckYE(year, ref era);
|
|
return 12;
|
|
}
|
|
|
|
/// <summary>Returns the year in the specified <see cref="T:System.DateTime" />.</summary>
|
|
/// <returns>An integer that represents the year in the specified <see cref="T:System.DateTime" />.</returns>
|
|
/// <param name="time">The <see cref="T:System.DateTime" /> to read. </param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06001396 RID: 5014 RVA: 0x0004C014 File Offset: 0x0004A214
|
|
public override int GetYear(DateTime time)
|
|
{
|
|
int num = this.M_FromDateTime(time);
|
|
this.M_CheckFixedHijri("time", num);
|
|
return CCHijriCalendar.year_from_fixed(num);
|
|
}
|
|
|
|
/// <summary>Determines whether the specified date 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">An integer from 1 to 12 that represents the month. </param>
|
|
/// <param name="day">An integer from 1 to 30 that represents the day. </param>
|
|
/// <param name="era">An integer that represents the era. </param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar.-or- <paramref name="month" /> is outside the range supported by this calendar.-or- <paramref name="day" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001397 RID: 5015 RVA: 0x0004C03C File Offset: 0x0004A23C
|
|
public override bool IsLeapDay(int year, int month, int day, int era)
|
|
{
|
|
this.M_CheckYMDE(year, month, day, ref era);
|
|
return this.IsLeapYear(year) && month == 12 && day == 30;
|
|
}
|
|
|
|
/// <summary>Determines whether the specified month in the specified year and era is a leap month.</summary>
|
|
/// <returns>This method always returns false.</returns>
|
|
/// <param name="year">An integer that represents the year. </param>
|
|
/// <param name="month">An integer from 1 to 12 that represents the month. </param>
|
|
/// <param name="era">An integer that represents the era. </param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar.-or- <paramref name="month" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001398 RID: 5016 RVA: 0x0004C068 File Offset: 0x0004A268
|
|
public override bool IsLeapMonth(int year, int month, int era)
|
|
{
|
|
this.M_CheckYME(year, month, ref era);
|
|
return false;
|
|
}
|
|
|
|
/// <summary>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="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar. </exception>
|
|
// Token: 0x06001399 RID: 5017 RVA: 0x0004C078 File Offset: 0x0004A278
|
|
public override bool IsLeapYear(int year, int era)
|
|
{
|
|
this.M_CheckYE(year, ref era);
|
|
return CCHijriCalendar.is_leap_year(year);
|
|
}
|
|
|
|
/// <summary>Returns a <see cref="T:System.DateTime" /> that is set to the specified date, time, and 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">An integer from 1 to 12 that represents the month. </param>
|
|
/// <param name="day">An integer from 1 to 30 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="era" /> is outside the range supported by this calendar. -or- <paramref name="year" /> is outside the range supported by this calendar.-or- <paramref name="month" /> is outside the range supported by this calendar.-or- <paramref name="day" /> is outside the range supported by this 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>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="\" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600139A RID: 5018 RVA: 0x0004C08C File Offset: 0x0004A28C
|
|
public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
|
|
{
|
|
this.M_CheckYMDE(year, month, day, ref era);
|
|
base.M_CheckHMSM(hour, minute, second, millisecond);
|
|
int num = CCHijriCalendar.fixed_from_dmy(day, month, year);
|
|
return this.M_ToDateTime(num, hour, minute, second, millisecond);
|
|
}
|
|
|
|
/// <summary>Converts the specified year to a four-digit year by using the <see cref="P:System.Globalization.HijriCalendar.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 this calendar. </exception>
|
|
// Token: 0x0600139B RID: 5019 RVA: 0x0004C0CC File Offset: 0x0004A2CC
|
|
public override int ToFourDigitYear(int year)
|
|
{
|
|
return base.ToFourDigitYear(year);
|
|
}
|
|
|
|
/// <summary>Gets the earliest date and time supported by this calendar.</summary>
|
|
/// <returns>The earliest date and time supported by the <see cref="T:System.Globalization.HijriCalendar" /> type, which is equivalent to the first moment of July 18, 622 C.E. in the Gregorian calendar.</returns>
|
|
// Token: 0x1700035C RID: 860
|
|
// (get) Token: 0x0600139C RID: 5020 RVA: 0x0004C0D8 File Offset: 0x0004A2D8
|
|
[ComVisible(false)]
|
|
public override DateTime MinSupportedDateTime
|
|
{
|
|
get
|
|
{
|
|
return HijriCalendar.Min;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the latest date and time supported by this calendar.</summary>
|
|
/// <returns>The latest date and time supported by the <see cref="T:System.Globalization.HijriCalendar" /> type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar.</returns>
|
|
// Token: 0x1700035D RID: 861
|
|
// (get) Token: 0x0600139D RID: 5021 RVA: 0x0004C0E0 File Offset: 0x0004A2E0
|
|
[ComVisible(false)]
|
|
public override DateTime MaxSupportedDateTime
|
|
{
|
|
get
|
|
{
|
|
return HijriCalendar.Max;
|
|
}
|
|
}
|
|
|
|
/// <summary>Represents the current era. This field is constant.</summary>
|
|
// Token: 0x0400056B RID: 1387
|
|
public static readonly int HijriEra = 1;
|
|
|
|
// Token: 0x0400056C RID: 1388
|
|
internal static readonly int M_MinFixed = CCHijriCalendar.fixed_from_dmy(1, 1, 1);
|
|
|
|
// Token: 0x0400056D RID: 1389
|
|
internal static readonly int M_MaxFixed = CCGregorianCalendar.fixed_from_dmy(31, 12, 9999);
|
|
|
|
// Token: 0x0400056E RID: 1390
|
|
internal int M_AddHijriDate;
|
|
|
|
// Token: 0x0400056F RID: 1391
|
|
private static DateTime Min = new DateTime(622, 7, 18, 0, 0, 0);
|
|
|
|
// Token: 0x04000570 RID: 1392
|
|
private static DateTime Max = new DateTime(9999, 12, 31, 11, 59, 59);
|
|
}
|
|
}
|