Merge pull request #726 from pruiz/xamarin-bug-13708
[mono.git] / mcs / class / corlib / System.Globalization / HijriCalendar.cs
index 781c22146c41256b015a5125740133cca8ef0f06..7d4d60a367b1acbf2f9e8c5ef2746eb36acbfea4 100644 (file)
@@ -1,4 +1,4 @@
-// HijriCalendar.cs
+// System.Globalization.HijriCalendar.cs
 //
 // (C) Ulrich Kunitz 2002
 //
@@ -30,6 +30,7 @@ namespace System.Globalization {
 
 using System;
 using System.IO;
+using System.Runtime.InteropServices;
 
 
 /// <summary>
@@ -53,7 +54,8 @@ using System.IO;
 /// </para>
 /// </remarks>
 [Serializable]
-[MonoTODO ("Fix serialization compatibility with MS.NET")]
+[ComVisible (true)]
+[MonoLimitation ("Serialization format not compatible with .NET")]
 public class HijriCalendar : Calendar {
        /// <summary>
        /// Constructor.
@@ -61,8 +63,8 @@ public class HijriCalendar : Calendar {
        public HijriCalendar() {
                M_AbbrEraNames = new string[] {"A.H."};
                M_EraNames = new string[] {"Anno Hegirae"};
-               if (M_TwoDigitYearMax == 99)
-                       M_TwoDigitYearMax = 1451;
+               if (twoDigitYearMax == 99)
+                       twoDigitYearMax = 1451;
        }
 
        /// <summary>
@@ -90,21 +92,7 @@ public class HijriCalendar : Calendar {
                }
        }
 
-#if NET_1_1
-       [MonoTODO]
-       public int HijriAdjustment {
-               get {
-                       throw new NotImplementedException ();
-               }
-               set {
-                       throw new NotImplementedException ();
-               }
-       }
-#endif
-
-       int twoDigitYearMax = 1451;
-       
-       [MonoTODO ("Add call into operating system")]
+       // FIXME: [MonoTODO ("Add call into operating system")]
        public override int TwoDigitYearMax 
        {
                get {
@@ -756,6 +744,12 @@ public class HijriCalendar : Calendar {
                return HijriEra;
        }
 
+       [ComVisible (false)]
+       public override int GetLeapMonth (int year, int era)
+       {
+               return 0;
+       }
+
        /// <summary>
        /// Overridden. Gives the number of the month of the specified
        /// date.
@@ -916,45 +910,52 @@ public class HijriCalendar : Calendar {
        /// is out of range.
        /// </exception>
        public override DateTime ToDateTime(int year, int month, int day,
-               int hour, int minute, int second, int milliseconds,
+               int hour, int minute, int second, int millisecond,
                int era)
        {
                M_CheckYMDE(year, month, day, ref era);
-               M_CheckHMSM(hour, minute, second, milliseconds);
+               M_CheckHMSM(hour, minute, second, millisecond);
                int rd = CCHijriCalendar.fixed_from_dmy(day, month, year);
                return M_ToDateTime(rd,
-                       hour, minute, second, milliseconds);
+                       hour, minute, second, millisecond);
        }
 
-       [MonoTODO]
        public override int ToFourDigitYear(int year)
        {
-               throw new NotImplementedException();
+               return base.ToFourDigitYear (year);
        }
 
-#if NET_2_0
+#if !NET_2_1
+       [ComVisible (false)]
        public override CalendarAlgorithmType AlgorithmType  {
                get {
                        return CalendarAlgorithmType.LunarCalendar;
                }
        }
+#endif
 
        static DateTime Min = new DateTime (622, 7, 18, 0, 0, 0);
        static DateTime Max = new DateTime (9999, 12, 31, 11, 59, 59);
                
+       [ComVisible (false)]
        public override DateTime MinSupportedDateTime {
                get {
                        return Min;
                }
        }
 
+       [ComVisible (false)]
        public override DateTime MaxSupportedDateTime {
                get {
                        return Max;
                }
        }
-#endif
        
+       [MonoTODO ()]
+       public int HijriAdjustment {
+               get { throw new NotImplementedException (); }
+               set { throw new NotImplementedException (); }
+       }
 } // class HijriCalendar
        
 } // namespace System.Globalization