We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
__DateBuffer
-
Expand
BaseInfoTable
-
Expand
BidiCategory
-
Expand
Calendar
-
Expand
CalendarAlgorithmType
-
Expand
CalendarId
-
Expand
CalendarTable
-
Expand
CalendarTableData
-
Expand
CalendarWeekRule
-
Expand
CharUnicodeInfo
-
Expand
ChineseLunisolarCalendar
-
Expand
CodePageDataItem
-
Expand
CompareInfo
-
Expand
CompareOptions
-
Expand
CultureData
-
Expand
CultureFlags
-
Expand
CultureInfo
-
Expand
CultureNameOffsetItem
-
Expand
CultureTable
-
Expand
CultureTableData
-
Expand
CultureTableHeader
-
Expand
CultureTableItem
-
Expand
CultureTableRecord
-
Expand
CultureTypes
-
Expand
DateMapping
-
Expand
DateTimeFormatFlags
-
Expand
DateTimeFormatInfo
-
Expand
DateTimeFormatInfoScanner
-
Expand
DateTimeStyles
-
Expand
DaylightTime
-
Expand
DigitShapes
-
Expand
DigitValues
-
Expand
DTFIUserOverrideValues
-
Expand
EastAsianLunisolarCalendar
-
Expand
EncodingTable
-
Expand
EndianessHeader
-
Expand
EraInfo
-
Expand
ExceptionTableItem
-
Expand
FORMATFLAGS
-
Expand
FoundDatePattern
-
Expand
GlobalizationAssembly
-
Expand
GregorianCalendar
-
AddMonths(DateTime, int)
-
AddYears(DateTime, int)
-
AlgorithmType()
-
CalendarType()
-
DateToTicks(int, int, int)
-
Eras()
-
GetAbsoluteDate(int, int, int)
-
GetDatePart(long, int)
-
GetDayOfMonth(DateTime)
-
GetDayOfWeek(DateTime)
-
GetDayOfYear(DateTime)
-
GetDaysInMonth(int, int, int)
-
GetDaysInYear(int, int)
-
GetDefaultInstance()
-
GetEra(DateTime)
-
GetLeapMonth(int, int)
-
GetMonth(DateTime)
-
GetMonthsInYear(int, int)
-
GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek)
-
GetYear(DateTime)
-
GregorianCalendar()
-
GregorianCalendar(GregorianCalendarTypes)
-
ID()
-
InternalGetWeekOfYearFullDays(Calendar, DateTime, int, int, int)
-
IsLeapDay(int, int, int, int)
-
IsLeapMonth(int, int, int)
-
IsLeapYear(int, int)
-
MaxSupportedDateTime()
-
MinSupportedDateTime()
-
ToDateTime(int, int, int, int, int, int, int, int)
-
ToFourDigitYear(int)
-
TryToDateTime(int, int, int, int, int, int, int, int, DateTime)
-
TwoDigitYearMax()
-
Expand
GregorianCalendarHelper
-
Expand
GregorianCalendarTypes
-
Expand
HebrewCalendar
-
Expand
HebrewNumber
-
Expand
HebrewNumberParsingContext
-
Expand
HebrewNumberParsingState
-
Expand
HebrewToken
-
Expand
HebrewValue
-
Expand
HijriCalendar
-
Expand
HS
-
Expand
IdnMapping
-
Expand
IDOffsetItem
-
Expand
IetfNameOffsetItem
-
Expand
InternalCodePageDataItem
-
Expand
InternalEncodingDataItem
-
Expand
JapaneseCalendar
-
Expand
JapaneseLunisolarCalendar
-
Expand
JulianCalendar
-
Expand
KoreanCalendar
-
Expand
KoreanLunisolarCalendar
-
Expand
MemoryMapFile
-
Expand
MonthNameStyles
-
Expand
NumberFormatInfo
-
Expand
NumberStyles
-
Expand
PersianCalendar
-
Expand
RegionInfo
-
Expand
RegionNameOffsetItem
-
Expand
SortKey
-
Expand
StringInfo
-
Expand
TaiwanCalendar
-
Expand
TaiwanLunisolarCalendar
-
Expand
TextElementEnumerator
-
Expand
TextInfo
-
Expand
TextInfoDataHeader
-
Expand
ThaiBuddhistCalendar
-
Expand
TokenHashValue
-
Expand
UmAlQuraCalendar
-
Expand
UnicodeCategory
-
Expand
UnicodeDataHeader
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- namespace System.Globalization
- {
-
-
-
-
-
-
-
-
-
- using System.Threading;
- using System;
- using System.Globalization;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable()]
- public class GregorianCalendar : Calendar
- {
-
-
- public const int ADEra = 1;
-
-
- internal const int DatePartYear = 0;
- internal const int DatePartDayOfYear = 1;
- internal const int DatePartMonth = 2;
- internal const int DatePartDay = 3;
-
-
-
-
-
- internal const int MaxYear = 9999;
-
- internal GregorianCalendarTypes m_type;
-
- static internal readonly int[] DaysToMonth365 = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273,
- 304, 334, 365};
-
- static internal readonly int[] DaysToMonth366 = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274,
- 305, 335, 366};
-
- static internal Calendar m_defaultInstance = null;
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public override DateTime MinSupportedDateTime {
- get { return (DateTime.MinValue); }
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public override DateTime MaxSupportedDateTime {
- get { return (DateTime.MaxValue); }
- }
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public override CalendarAlgorithmType AlgorithmType {
- get { return CalendarAlgorithmType.SolarCalendar; }
- }
-
-
-
- static internal Calendar GetDefaultInstance()
- {
- if (m_defaultInstance == null) {
- m_defaultInstance = new GregorianCalendar();
- }
- return (m_defaultInstance);
- }
-
-
-
- public GregorianCalendar() : this(GregorianCalendarTypes.Localized)
- {
- }
-
-
- public GregorianCalendar(GregorianCalendarTypes type)
- {
- if ((int)type < (int)GregorianCalendarTypes.Localized || (int)type > (int)GregorianCalendarTypes.TransliteratedFrench) {
- throw new ArgumentOutOfRangeException("type", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), GregorianCalendarTypes.Localized, GregorianCalendarTypes.TransliteratedFrench));
- }
- this.m_type = type;
- }
-
- public virtual GregorianCalendarTypes CalendarType {
- get { return (m_type); }
-
- set {
- VerifyWritable();
-
- switch (value) {
- case GregorianCalendarTypes.Localized:
- case GregorianCalendarTypes.USEnglish:
- case GregorianCalendarTypes.MiddleEastFrench:
- case GregorianCalendarTypes.Arabic:
- case GregorianCalendarTypes.TransliteratedEnglish:
- case GregorianCalendarTypes.TransliteratedFrench:
- m_type = value;
- break;
- default:
-
- throw new ArgumentOutOfRangeException("m_type", Environment.GetResourceString("ArgumentOutOfRange_Enum"));
- break;
- }
- }
- }
-
- internal override int ID {
- get { return ((int)m_type); }
- }
-
-
-
-
- internal virtual int GetDatePart(long ticks, int part)
- {
-
- int n = (int)(ticks / TicksPerDay);
-
- int y400 = n / DaysPer400Years;
-
- n -= y400 * DaysPer400Years;
-
- int y100 = n / DaysPer100Years;
-
- if (y100 == 4)
- y100 = 3;
-
- n -= y100 * DaysPer100Years;
-
- int y4 = n / DaysPer4Years;
-
- n -= y4 * DaysPer4Years;
-
- int y1 = n / DaysPerYear;
-
- if (y1 == 4)
- y1 = 3;
-
- if (part == DatePartYear) {
- return (y400 * 400 + y100 * 100 + y4 * 4 + y1 + 1);
- }
-
- n -= y1 * DaysPerYear;
-
- if (part == DatePartDayOfYear) {
- return (n + 1);
- }
-
-
- bool leapYear = (y1 == 3 && (y4 != 24 || y100 == 3));
- int[] days = leapYear ? DaysToMonth366 : DaysToMonth365;
-
-
- int m = n >> 5 + 1;
-
- while (n >= days[m])
- m++;
-
- if (part == DatePartMonth)
- return (m);
-
- return (n - days[m - 1] + 1);
- }
-
-
-
- static internal long GetAbsoluteDate(int year, int month, int day)
- {
- if (year >= 1 && year <= MaxYear && month >= 1 && month <= 12) {
- int[] days = ((year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))) ? DaysToMonth366 : DaysToMonth365;
- if (day >= 1 && (day <= days[month] - days[month - 1])) {
- int y = year - 1;
- int absoluteDate = y * 365 + y / 4 - y / 100 + y / 400 + days[month - 1] + day - 1;
- return (absoluteDate);
- }
- }
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"));
- }
-
-
-
- internal virtual long DateToTicks(int year, int month, int day)
- {
- return (GetAbsoluteDate(year, month, day) * TicksPerDay);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public override DateTime AddMonths(DateTime time, int months)
- {
- if (months < -120000 || months > 120000) {
- throw new ArgumentOutOfRangeException("months", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), -120000, 120000));
- }
- int y = GetDatePart(time.Ticks, DatePartYear);
- int m = GetDatePart(time.Ticks, DatePartMonth);
- int d = GetDatePart(time.Ticks, DatePartDay);
- int i = m - 1 + months;
- if (i >= 0) {
- m = i % 12 + 1;
- y = y + i / 12;
- }
- else {
- m = 12 + (i + 1) % 12;
- y = y + (i - 11) / 12;
- }
- int[] daysArray = (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) ? DaysToMonth366 : DaysToMonth365;
- int days = (daysArray[m] - daysArray[m - 1]);
-
- if (d > days) {
- d = days;
- }
- long ticks = DateToTicks(y, m, d) + time.Ticks % TicksPerDay;
- Calendar.CheckAddResult(ticks, MinSupportedDateTime, MaxSupportedDateTime);
-
- return (new DateTime(ticks));
- }
-
-
-
-
-
-
-
-
-
-
-
- public override DateTime AddYears(DateTime time, int years)
- {
- return (AddMonths(time, years * 12));
- }
-
-
-
-
-
- public override int GetDayOfMonth(DateTime time)
- {
- return (GetDatePart(time.Ticks, DatePartDay));
- }
-
-
-
-
-
-
-
- public override DayOfWeek GetDayOfWeek(DateTime time)
- {
- return ((DayOfWeek)((int)(time.Ticks / TicksPerDay + 1) % 7));
- }
-
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
- {
- if ((int)firstDayOfWeek < 0 || (int)firstDayOfWeek > 6) {
- throw new ArgumentOutOfRangeException("firstDayOfWeek", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), DayOfWeek.Sunday, DayOfWeek.Saturday));
- }
- switch (rule) {
- case CalendarWeekRule.FirstDay:
- return (GetFirstDayWeekOfYear(time, (int)firstDayOfWeek));
- case CalendarWeekRule.FirstFullWeek:
- return (InternalGetWeekOfYearFullDays(this, time, (int)firstDayOfWeek, 7, 365));
- case CalendarWeekRule.FirstFourDayWeek:
- return (InternalGetWeekOfYearFullDays(this, time, (int)firstDayOfWeek, 4, 365));
- }
- throw new ArgumentOutOfRangeException("rule", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), CalendarWeekRule.FirstDay, CalendarWeekRule.FirstFourDayWeek));
-
- }
-
-
-
-
-
-
-
-
-
- static internal int InternalGetWeekOfYearFullDays(Calendar cal, DateTime time, int firstDayOfWeek, int fullDays, int daysOfMinYearMinusOne)
- {
- int dayForJan1;
- int offset;
- int day;
-
- int dayOfYear = cal.GetDayOfYear(time) - 1;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dayForJan1 = (int)cal.GetDayOfWeek(time) - (dayOfYear % 7);
-
-
- offset = (firstDayOfWeek - dayForJan1 + 14) % 7;
- if (offset != 0 && offset >= fullDays) {
-
-
-
-
- offset -= 7;
- }
-
-
-
- day = dayOfYear - offset;
- if (day >= 0) {
-
-
-
- return (day / 7 + 1);
- }
-
-
-
-
-
-
- int year = cal.GetYear(time);
- if (year <= cal.GetYear(cal.MinSupportedDateTime)) {
-
- dayOfYear = daysOfMinYearMinusOne;
- }
- else {
- dayOfYear = cal.GetDaysInYear(year - 1);
- }
- dayForJan1 = dayForJan1 - (dayOfYear % 7);
-
- offset = (firstDayOfWeek - dayForJan1 + 14) % 7;
- if (offset != 0 && offset >= fullDays) {
-
-
-
-
- offset -= 7;
- }
-
-
-
- day = dayOfYear - offset;
- return (day / 7 + 1);
- }
-
-
-
-
-
-
-
- public override int GetDayOfYear(DateTime time)
- {
- return (GetDatePart(time.Ticks, DatePartDayOfYear));
- }
-
-
-
-
-
- public override int GetDaysInMonth(int year, int month, int era)
- {
- if (era == CurrentEra || era == ADEra) {
- if (year < 1 || year > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- if (month < 1 || month > 12) {
- throw new ArgumentOutOfRangeException("month", Environment.GetResourceString("ArgumentOutOfRange_Month"));
- }
- int[] days = ((year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? DaysToMonth366 : DaysToMonth365);
- return (days[month] - days[month - 1]);
- }
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
-
-
-
- public override int GetDaysInYear(int year, int era)
- {
- if (era == CurrentEra || era == ADEra) {
- if (year >= 1 && year <= MaxYear) {
- return ((year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? 366 : 365);
- }
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
-
-
- public override int GetEra(DateTime time)
- {
- return (ADEra);
- }
-
-
- public override int[] Eras {
- get { return (new int[] {ADEra}); }
- }
-
-
-
-
-
-
- public override int GetMonth(DateTime time)
- {
- return (GetDatePart(time.Ticks, DatePartMonth));
- }
-
-
-
- public override int GetMonthsInYear(int year, int era)
- {
- if (era == CurrentEra || era == ADEra) {
- if (year >= 1 && year <= MaxYear) {
- return (12);
- }
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
-
-
-
-
- public override int GetYear(DateTime time)
- {
- return (GetDatePart(time.Ticks, DatePartYear));
- }
-
-
-
-
-
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- if (era != CurrentEra && era != ADEra) {
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
- if (year < 1 || year > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
-
- if (month < 1 || month > 12) {
- throw new ArgumentOutOfRangeException("month", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, 12));
- }
- if (day < 1 || day > GetDaysInMonth(year, month)) {
- throw new ArgumentOutOfRangeException("day", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, GetDaysInMonth(year, month)));
- }
- if (!IsLeapYear(year)) {
- return (false);
- }
- if (month == 2 && day == 29) {
- return (true);
- }
- return (false);
- }
-
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public override int GetLeapMonth(int year, int era)
- {
- if (era != CurrentEra && era != ADEra) {
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
- if (year < 1 || year > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- return (0);
- }
-
-
-
-
-
- public override bool IsLeapMonth(int year, int month, int era)
- {
- if (era != CurrentEra && era != ADEra) {
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
- if (year < 1 || year > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
-
- if (month < 1 || month > 12) {
- throw new ArgumentOutOfRangeException("month", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, 12));
- }
- return (false);
-
- }
-
-
-
-
-
- public override bool IsLeapYear(int year, int era)
- {
- if (era == CurrentEra || era == ADEra) {
- if (year >= 1 && year <= MaxYear) {
- return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
- }
-
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
-
-
-
- public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
- {
- if (era == CurrentEra || era == ADEra) {
- return new DateTime(year, month, day, hour, minute, second, millisecond);
- }
- throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
- }
-
- internal override bool TryToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era, out DateTime result)
- {
- if (era == CurrentEra || era == ADEra) {
- return DateTime.TryCreate(year, month, day, hour, minute, second, millisecond, out result);
- }
- result = DateTime.MinValue;
- return false;
- }
-
- private const int DEFAULT_TWO_DIGIT_YEAR_MAX = 2029;
-
-
- public override int TwoDigitYearMax {
- get {
- if (twoDigitYearMax == -1) {
- twoDigitYearMax = GetSystemTwoDigitYearSetting(ID, DEFAULT_TWO_DIGIT_YEAR_MAX);
- }
- return (twoDigitYearMax);
- }
-
- set {
- VerifyWritable();
- if (value < 99 || value > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 99, MaxYear));
-
- }
- twoDigitYearMax = value;
- }
- }
-
-
- public override int ToFourDigitYear(int year)
- {
- if (year > MaxYear) {
- throw new ArgumentOutOfRangeException("year", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
- }
- return (base.ToFourDigitYear(year));
- }
- }
- }