}
}
-
-
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public virtual CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.Unknown;
+ }
+ }
protected Calendar()
{
//
////////////////////////////////////////////////////////////////////////
[System.Runtime.InteropServices.ComVisible(false)]
- internal static Calendar ReadOnly(Calendar calendar)
+ public static Calendar ReadOnly(Calendar calendar)
{
if (calendar == null) { throw new ArgumentNullException("calendar"); }
Contract.EndContractBlock();
public abstract bool IsLeapMonth(int year, int month, int era);
+ // Returns the leap month in a calendar year of the current era. This method returns 0
+ // if this calendar does not have leap month, or this year is not a leap year.
+ //
+
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public virtual int GetLeapMonth(int year)
+ {
+ return (GetLeapMonth(year, CurrentEra));
+ }
+
// Returns the leap month in a calendar year of the specified era. This method returns 0
// if this calendar does not have leap month, or this year is not a leap year.
//
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System.Globalization
+{
+ public enum CalendarAlgorithmType
+ {
+ Unknown = 0, // This is the default value to return in the Calendar base class.
+ SolarCalendar = 1, // Solar-base calendar, such as GregorianCalendar, jaoaneseCalendar, JulianCalendar, etc.
+ // Solar calendars are based on the solar year and seasons.
+ LunarCalendar = 2, // Lunar-based calendar, such as Hijri and UmAlQuraCalendar.
+ // Lunar calendars are based on the path of the moon. The seasons are not accurately represented.
+ LunisolarCalendar = 3 // Lunisolar-based calendar which use leap month rule, such as HebrewCalendar and Asian Lunisolar calendars.
+ // Lunisolar calendars are based on the cycle of the moon, but consider the seasons as a secondary consideration,
+ // so they align with the seasons as well as lunar events.
+ }
+}
internal const int DatePartMonth = 2;
internal const int DatePartDay = 3;
- // Return the type of the East Asian Lunisolar calendars.
- //
-
- //public override CalendarAlgorithmType AlgorithmType {
- // get {
- // return CalendarAlgorithmType.LunisolarCalendar;
- // }
- //}
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.LunisolarCalendar;
+ }
+ }
// Return the year number in the 60-year cycle.
//
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
+
/*=================================GetDefaultInstance==========================
**Action: Internal method to provide a default intance of GregorianCalendar. Used by NLS+ implementation
** and other calendars.
}
}
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.LunisolarCalendar;
+ }
+ }
+
public HebrewCalendar()
{
}
[System.Runtime.InteropServices.ComVisible(true)]
public partial class HijriCalendar : Calendar
{
- internal static readonly int HijriEra = 1;
+ public static readonly int HijriEra = 1;
internal const int DatePartYear = 0;
internal const int DatePartDayOfYear = 1;
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.LunarCalendar;
+ }
+ }
+
public HijriCalendar()
{
}
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
+
//
// Using a field initializer rather than a static constructor so that the whole class can be lazy
// init.
}
}
- // Return the type of the Julian calendar.
- //
-
- //[System.Runtime.InteropServices.ComVisible(false)]
- //public override CalendarAlgorithmType AlgorithmType
- //{
- // get
- // {
- // return CalendarAlgorithmType.SolarCalendar;
- // }
- //}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
public JulianCalendar()
{
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
+
public KoreanCalendar()
{
try
}
}
- // Return the type of the Persian calendar.
- //
-
-
- //public override CalendarAlgorithmType AlgorithmType {
- // get {
- // return CalendarAlgorithmType.SolarCalendar;
- // }
- //}
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
// Construct an instance of Persian calendar.
namespace System.Globalization
{
- public abstract partial class Calendar : System.ICloneable
- {
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public virtual int GetLeapMonth(int year) { throw new NotImplementedException(); }
- }
-
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum CalendarAlgorithmType
- {
- Unknown = 0, // This is the default value to return in the Calendar base class.
- SolarCalendar = 1, // Solar-base calendar, such as GregorianCalendar, jaoaneseCalendar, JulianCalendar, etc.
- // Solar calendars are based on the solar year and seasons.
- LunarCalendar = 2, // Lunar-based calendar, such as Hijri and UmAlQuraCalendar.
- // Lunar calendars are based on the path of the moon. The seasons are not accurately represented.
- LunisolarCalendar = 3 // Lunisolar-based calendar which use leap month rule, such as HebrewCalendar and Asian Lunisolar calendars.
- // Lunisolar calendars are based on the cycle of the moon, but consider the seasons as a secondary consideration,
- // so they align with the seasons as well as lunar events.
- }
-
public partial class CompareInfo : System.Runtime.Serialization.IDeserializationCallback
{
public int LCID { get { throw new NotImplementedException(); } }
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
+
// Return the type of the Taiwan calendar.
//
}
}
+ [System.Runtime.InteropServices.ComVisible(false)]
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.SolarCalendar;
+ }
+ }
+
public ThaiBuddhistCalendar()
{
helper = new GregorianCalendarHelper(this, thaiBuddhistEraInfo);
}
}
+ public override CalendarAlgorithmType AlgorithmType
+ {
+ get
+ {
+ return CalendarAlgorithmType.LunarCalendar;
+ }
+ }
+
public UmAlQuraCalendar()
{
}
<Member Name="#ctor" />
<Member Name="AddMonths(System.DateTime,System.Int32)" />
<Member Name="AddYears(System.DateTime,System.Int32)" />
- <Member Name="get_AlgorithmType" Condition="not FEATURE_COREFX_GLOBALIZATION" />
+ <Member Name="get_AlgorithmType" />
<Member Name="get_Eras" />
<Member Name="get_MaxSupportedDateTime" />
<Member Name="get_MinSupportedDateTime" />
<Type Name="System.Globalization.EastAsianLunisolarCalendar">
<Member Name="AddMonths(System.DateTime,System.Int32)" />
<Member Name="AddYears(System.DateTime,System.Int32)" />
- <Member Name="get_AlgorithmType" Condition="not FEATURE_COREFX_GLOBALIZATION" />
+ <Member Name="get_AlgorithmType" />
<Member Name="get_TwoDigitYearMax" />
<Member Name="GetCelestialStem(System.Int32)" />
<Member Name="GetDayOfMonth(System.DateTime)" />
<Member Name="#ctor" />
<Member Name="AddMonths(System.DateTime,System.Int32)" />
<Member Name="AddYears(System.DateTime,System.Int32)" />
- <Member Name="get_AlgorithmType" Condition="not FEATURE_COREFX_GLOBALIZATION" />
+ <Member Name="get_AlgorithmType" />
<Member Name="get_Eras" />
<Member Name="get_MaxSupportedDateTime" />
<Member Name="get_MinSupportedDateTime" />
<GlobalizationSources Include="$(CoreFxSourcesRoot)\SR.cs" />
<GlobalizationSources Condition="'$(FeatureCoreClr)'=='true'" Include="$(CoreFxSourcesRoot)\System\Globalization\STUBS.cs" />
<GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\Calendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarAlgorithmType.cs" />
<GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarData.cs" />
<GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarWeekRule.cs" />
<GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendricalCalculationsHelper.cs" />