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
-
Add(DateTime, double, int)
-
AddDays(DateTime, int)
-
AddHours(DateTime, int)
-
AddMilliseconds(DateTime, double)
-
AddMinutes(DateTime, int)
-
AddMonths(DateTime, int)
-
AddSeconds(DateTime, int)
-
AddWeeks(DateTime, int)
-
AddYears(DateTime, int)
-
AlgorithmType()
-
BaseCalendarID()
-
Calendar()
-
CheckAddResult(long, DateTime, DateTime)
-
Clone()
-
CurrentEraValue()
-
Eras()
-
GetDayOfMonth(DateTime)
-
GetDayOfWeek(DateTime)
-
GetDayOfYear(DateTime)
-
GetDaysInMonth(int, int)
-
GetDaysInMonth(int, int, int)
-
GetDaysInYear(int)
-
GetDaysInYear(int, int)
-
GetEra(DateTime)
-
GetFirstDayWeekOfYear(DateTime, int)
-
GetHour(DateTime)
-
GetLeapMonth(int)
-
GetLeapMonth(int, int)
-
GetMilliseconds(DateTime)
-
GetMinute(DateTime)
-
GetMonth(DateTime)
-
GetMonthsInYear(int)
-
GetMonthsInYear(int, int)
-
GetSecond(DateTime)
-
GetSystemTwoDigitYearSetting(int, int)
-
GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek)
-
GetWeekOfYearFullDays(DateTime, CalendarWeekRule, int, int)
-
GetYear(DateTime)
-
ID()
-
IsLeapDay(int, int, int)
-
IsLeapDay(int, int, int, int)
-
IsLeapMonth(int, int)
-
IsLeapMonth(int, int, int)
-
IsLeapYear(int)
-
IsLeapYear(int, int)
-
IsReadOnly()
-
IsValidDay(int, int, int, int)
-
IsValidMonth(int, int, int)
-
IsValidYear(int, int)
-
MaxSupportedDateTime()
-
MinSupportedDateTime()
-
nativeGetTwoDigitYearMax(int)
-
ReadOnly(Calendar)
-
SetReadOnlyState(bool)
-
TimeToTicks(int, int, int, int)
-
ToDateTime(int, int, int, int, int, int, int)
-
ToDateTime(int, int, int, int, int, int, int, int)
-
ToFourDigitYear(int)
-
TryToDateTime(int, int, int, int, int, int, int, int, DateTime)
-
TwoDigitYearMax()
-
VerifyWritable()
-
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
-
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;
- using System.Runtime.CompilerServices;
- using System.Globalization;
- using System.Runtime.Versioning;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public abstract class Calendar : ICloneable
- {
-
-
- internal const long TicksPerMillisecond = 10000;
- internal const long TicksPerSecond = TicksPerMillisecond * 1000;
- internal const long TicksPerMinute = TicksPerSecond * 60;
- internal const long TicksPerHour = TicksPerMinute * 60;
- internal const long TicksPerDay = TicksPerHour * 24;
-
-
- internal const int MillisPerSecond = 1000;
- internal const int MillisPerMinute = MillisPerSecond * 60;
- internal const int MillisPerHour = MillisPerMinute * 60;
- internal const int MillisPerDay = MillisPerHour * 24;
-
-
- internal const int DaysPerYear = 365;
-
- internal const int DaysPer4Years = DaysPerYear * 4 + 1;
-
- internal const int DaysPer100Years = DaysPer4Years * 25 - 1;
-
- internal const int DaysPer400Years = DaysPer100Years * 4 + 1;
-
-
- internal const int DaysTo10000 = DaysPer400Years * 25 - 366;
-
- internal const long MaxMillis = (long)DaysTo10000 * MillisPerDay;
-
-
-
-
-
-
- internal const int CAL_GREGORIAN = 1;
-
- internal const int CAL_GREGORIAN_US = 2;
-
- internal const int CAL_JAPAN = 3;
-
- internal const int CAL_TAIWAN = 4;
-
- internal const int CAL_KOREA = 5;
-
- internal const int CAL_HIJRI = 6;
-
- internal const int CAL_THAI = 7;
-
- internal const int CAL_HEBREW = 8;
-
- internal const int CAL_GREGORIAN_ME_FRENCH = 9;
-
- internal const int CAL_GREGORIAN_ARABIC = 10;
-
- internal const int CAL_GREGORIAN_XLIT_ENGLISH = 11;
-
- internal const int CAL_GREGORIAN_XLIT_FRENCH = 12;
- internal const int CAL_JULIAN = 13;
- internal const int CAL_JAPANESELUNISOLAR = 14;
- internal const int CAL_CHINESELUNISOLAR = 15;
- internal const int CAL_SAKA = 16;
-
- internal const int CAL_LUNAR_ETO_CHN = 17;
-
- internal const int CAL_LUNAR_ETO_KOR = 18;
-
- internal const int CAL_LUNAR_ETO_ROKUYOU = 19;
-
- internal const int CAL_KOREANLUNISOLAR = 20;
- internal const int CAL_TAIWANLUNISOLAR = 21;
- internal const int CAL_PERSIAN = 22;
- internal const int CAL_UMALQURA = 23;
-
- internal int m_currentEraValue = -1;
-
- [System.Runtime.Serialization.OptionalField(VersionAdded = 2)]
- private bool m_isReadOnly = false;
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual DateTime MinSupportedDateTime {
- get { return (DateTime.MinValue); }
- }
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual DateTime MaxSupportedDateTime {
- get { return (DateTime.MaxValue); }
- }
-
-
-
-
- protected Calendar()
- {
-
- }
-
- ///
-
-
- internal virtual int ID {
- get { return (-1); }
- }
-
- ///
-
-
-
- internal virtual int BaseCalendarID {
- get { return ID; }
- }
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual CalendarAlgorithmType AlgorithmType {
- get { return CalendarAlgorithmType.Unknown; }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
- [System.Runtime.InteropServices.ComVisible(false)]
- public bool IsReadOnly {
- get { return (m_isReadOnly); }
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual object Clone()
- {
- object o = MemberwiseClone();
- ((Calendar)o).SetReadOnlyState(false);
- return (o);
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
- [System.Runtime.InteropServices.ComVisible(false)]
- public static Calendar ReadOnly(Calendar calendar)
- {
- if (calendar == null) {
- throw new ArgumentNullException("calendar");
- }
- if (calendar.IsReadOnly) {
- return (calendar);
- }
-
- Calendar clonedCalendar = (Calendar)(calendar.MemberwiseClone());
- clonedCalendar.SetReadOnlyState(true);
-
- return (clonedCalendar);
- }
-
- internal void VerifyWritable()
- {
- if (m_isReadOnly) {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
- }
- }
-
- internal void SetReadOnlyState(bool readOnly)
- {
- m_isReadOnly = readOnly;
- }
-
-
-
-
- internal virtual int CurrentEraValue {
- get {
-
- if (m_currentEraValue == -1) {
- BCLDebug.Assert(BaseCalendarID > 0, "[Calendar.CurrentEraValue] Expected ID > 0");
- m_currentEraValue = CalendarTable.Default.ICURRENTERA(BaseCalendarID);
- }
- return (m_currentEraValue);
- }
- }
-
-
-
- public const int CurrentEra = 0;
-
- internal int twoDigitYearMax = -1;
-
- static internal void CheckAddResult(long ticks, DateTime minValue, DateTime maxValue)
- {
- if (ticks < minValue.Ticks || ticks > maxValue.Ticks) {
- throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Argument_ResultCalendarRange"), minValue, maxValue));
- }
- }
-
- internal DateTime Add(DateTime time, double value, int scale)
- {
- long millis = (long)(value * scale + (value >= 0 ? 0.5 : -0.5));
- if (millis <= -MaxMillis || millis >= MaxMillis) {
- throw new ArgumentOutOfRangeException("value", Environment.GetResourceString("ArgumentOutOfRange_AddValue"));
- }
- long ticks = time.Ticks + millis * TicksPerMillisecond;
- CheckAddResult(ticks, MinSupportedDateTime, MaxSupportedDateTime);
- return (new DateTime(ticks));
- }
-
-
-
-
-
-
-
-
- public virtual DateTime AddMilliseconds(DateTime time, double milliseconds)
- {
- return (Add(time, milliseconds, 1));
- }
-
-
-
-
-
-
-
-
-
- public virtual DateTime AddDays(DateTime time, int days)
- {
- return (Add(time, days, MillisPerDay));
- }
-
-
-
-
-
-
-
-
- public virtual DateTime AddHours(DateTime time, int hours)
- {
- return (Add(time, hours, MillisPerHour));
- }
-
-
-
-
-
-
-
-
-
- public virtual DateTime AddMinutes(DateTime time, int minutes)
- {
- return (Add(time, minutes, MillisPerMinute));
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public abstract DateTime AddMonths(DateTime time, int months);
-
-
-
-
-
-
-
-
- public virtual DateTime AddSeconds(DateTime time, int seconds)
- {
- return Add(time, seconds, MillisPerSecond);
- }
-
-
-
-
-
-
- public virtual DateTime AddWeeks(DateTime time, int weeks)
- {
- return (AddDays(time, weeks * 7));
- }
-
-
-
-
-
-
-
-
-
-
-
- public abstract DateTime AddYears(DateTime time, int years);
-
-
-
-
-
- public abstract int GetDayOfMonth(DateTime time);
-
-
-
-
-
-
-
- public abstract DayOfWeek GetDayOfWeek(DateTime time);
-
-
-
-
-
- public abstract int GetDayOfYear(DateTime time);
-
-
-
-
-
- public virtual int GetDaysInMonth(int year, int month)
- {
- return (GetDaysInMonth(year, month, CurrentEra));
- }
-
-
-
-
-
- public abstract int GetDaysInMonth(int year, int month, int era);
-
-
-
-
- public virtual int GetDaysInYear(int year)
- {
- return (GetDaysInYear(year, CurrentEra));
- }
-
-
-
-
- public abstract int GetDaysInYear(int year, int era);
-
-
-
- public abstract int GetEra(DateTime time);
-
-
-
-
- public abstract int[] Eras {
- get;
- }
-
-
-
-
-
-
- public virtual int GetHour(DateTime time)
- {
- return ((int)((time.Ticks / TicksPerHour) % 24));
- }
-
-
-
-
-
- public virtual double GetMilliseconds(DateTime time)
- {
- return (double)((time.Ticks / TicksPerMillisecond) % 1000);
- }
-
-
-
-
-
- public virtual int GetMinute(DateTime time)
- {
- return ((int)((time.Ticks / TicksPerMinute) % 60));
- }
-
-
-
-
-
- public abstract int GetMonth(DateTime time);
-
-
-
- public virtual int GetMonthsInYear(int year)
- {
- return (GetMonthsInYear(year, CurrentEra));
- }
-
-
-
- public abstract int GetMonthsInYear(int year, int era);
-
-
-
-
-
- public virtual int GetSecond(DateTime time)
- {
- return ((int)((time.Ticks / TicksPerSecond) % 60));
- }
-
-
-
- internal int GetFirstDayWeekOfYear(DateTime time, int firstDayOfWeek)
- {
- int dayOfYear = GetDayOfYear(time) - 1;
-
-
-
-
- int dayForJan1 = (int)GetDayOfWeek(time) - (dayOfYear % 7);
- int offset = (dayForJan1 - firstDayOfWeek + 14) % 7;
- BCLDebug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
- return ((dayOfYear + offset) / 7 + 1);
- }
-
- internal int GetWeekOfYearFullDays(DateTime time, CalendarWeekRule rule, int firstDayOfWeek, int fullDays)
- {
- int dayForJan1;
- int offset;
- int day;
-
- int dayOfYear = GetDayOfYear(time) - 1;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dayForJan1 = (int)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);
- }
-
-
-
-
- return (GetWeekOfYearFullDays(time.AddDays(-(dayOfYear + 1)), rule, firstDayOfWeek, fullDays));
- }
-
-
-
-
-
- public virtual 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 (GetWeekOfYearFullDays(time, rule, (int)firstDayOfWeek, 7));
- case CalendarWeekRule.FirstFourDayWeek:
- return (GetWeekOfYearFullDays(time, rule, (int)firstDayOfWeek, 4));
- }
- throw new ArgumentOutOfRangeException("rule", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), CalendarWeekRule.FirstDay, CalendarWeekRule.FirstFourDayWeek));
-
- }
-
-
-
-
-
- public abstract int GetYear(DateTime time);
-
-
-
-
-
- public virtual bool IsLeapDay(int year, int month, int day)
- {
- return (IsLeapDay(year, month, day, CurrentEra));
- }
-
-
-
-
-
- public abstract bool IsLeapDay(int year, int month, int day, int era);
-
-
-
-
-
- public virtual bool IsLeapMonth(int year, int month)
- {
- return (IsLeapMonth(year, month, CurrentEra));
- }
-
-
-
-
-
- public abstract bool IsLeapMonth(int year, int month, int era);
-
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual int GetLeapMonth(int year)
- {
- return (GetLeapMonth(year, CurrentEra));
- }
-
-
-
-
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual int GetLeapMonth(int year, int era)
- {
- if (!IsLeapYear(year, era))
- return 0;
-
- int monthsCount = GetMonthsInYear(year, era);
- for (int month = 1; month <= monthsCount; month++) {
- if (IsLeapMonth(year, month, era))
- return month;
- }
-
- return 0;
- }
-
-
-
-
-
- public virtual bool IsLeapYear(int year)
- {
- return (IsLeapYear(year, CurrentEra));
- }
-
-
-
-
-
- public abstract bool IsLeapYear(int year, int era);
-
-
-
-
- public virtual DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)
- {
- return (ToDateTime(year, month, day, hour, minute, second, millisecond, CurrentEra));
- }
-
-
-
-
- public abstract DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
-
- internal virtual bool TryToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era, out DateTime result)
- {
- result = DateTime.MinValue;
- try {
- result = ToDateTime(year, month, day, hour, minute, second, millisecond, era);
- return true;
- }
- catch (ArgumentException) {
- return false;
- }
- }
-
- internal virtual bool IsValidYear(int year, int era)
- {
- return (year >= GetYear(MinSupportedDateTime) && year <= GetYear(MaxSupportedDateTime));
- }
-
- internal virtual bool IsValidMonth(int year, int month, int era)
- {
- return (IsValidYear(year, era) && month >= 1 && month <= GetMonthsInYear(year, era));
- }
-
- internal virtual bool IsValidDay(int year, int month, int day, int era)
- {
- return (IsValidMonth(year, month, era) && day >= 1 && day <= GetDaysInMonth(year, month, era));
- }
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int nativeGetTwoDigitYearMax(int calID);
-
-
-
-
-
-
-
-
- public virtual int TwoDigitYearMax {
- get { return (twoDigitYearMax); }
-
- set {
- VerifyWritable();
- twoDigitYearMax = value;
- }
- }
-
-
-
-
-
-
- public virtual int ToFourDigitYear(int year)
- {
- if (year < 0) {
- throw new ArgumentOutOfRangeException("year", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
- if (year < 100) {
- return ((TwoDigitYearMax / 100 - (year > TwoDigitYearMax % 100 ? 1 : 0)) * 100 + year);
- }
-
-
- return (year);
- }
-
-
-
- static internal long TimeToTicks(int hour, int minute, int second, int millisecond)
- {
- if (hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60) {
- if (millisecond < 0 || millisecond >= MillisPerSecond) {
- throw new ArgumentOutOfRangeException("millisecond", String.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 0, MillisPerSecond - 1));
- }
- return TimeSpan.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond;
- }
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond"));
- }
-
-
-
- [ResourceExposure(ResourceScope.None)]
- [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
- static internal int GetSystemTwoDigitYearSetting(int CalID, int defaultYearValue)
- {
-
-
-
-
-
-
- int twoDigitYearMax = nativeGetTwoDigitYearMax(CalID);
- if (twoDigitYearMax < 0) {
- twoDigitYearMax = defaultYearValue;
- }
- return (twoDigitYearMax);
- }
-
- }
- }