public abstract int[] Eras { get; }
[NonSerialized]
- bool is_readonly;
+ bool m_isReadOnly;
#if NET_2_0
[System.Runtime.InteropServices.ComVisible(false)]
public virtual object Clone ()
{
Calendar c = (Calendar) MemberwiseClone ();
- c.is_readonly = false;
+ c.m_isReadOnly = false;
return c;
}
#endif
#if NET_2_0
public bool IsReadOnly {
- get { return is_readonly; }
+ get { return m_isReadOnly; }
}
public static Calendar ReadOnly (Calendar source)
{
- if (source.is_readonly)
+ if (source.m_isReadOnly)
return source;
Calendar c = (Calendar) source.Clone ();
- c.is_readonly = true;
+ c.m_isReadOnly = true;
return c;
}
#else
internal void CheckReadOnly ()
{
- if (is_readonly)
+ if (m_isReadOnly)
throw new InvalidOperationException ("This Calendar is read-only.");
}
/// property.
/// </summary>
[NonSerialized]
- internal int M_TwoDigitYearMax;
+ internal int twoDigitYearMax;
/// <summary>
/// <para>It might be overridden.</para>
/// </value>
public virtual int TwoDigitYearMax {
- get { return M_TwoDigitYearMax; }
+ get { return twoDigitYearMax; }
set {
CheckReadOnly ();
M_ArgumentInRange("year", value, 100, M_MaxYear);
int era = CurrentEra;
M_CheckYE(value, ref era);
- M_TwoDigitYearMax = value;
+ twoDigitYearMax = value;
}
}
/// in the ctors of the derived classes, if it is 99.
/// </remarks>
protected Calendar() {
- M_TwoDigitYearMax = 99;
+ twoDigitYearMax = 99;
}
/// <summary>Protected field storing the abbreviated era names.
M_EraNames = (string[])value.Clone();
}
}
+
+#if NET_2_0
+ internal int m_currentEraValue; // Unused, by MS serializes this
+#endif
+
} // class Calendar
} // namespace System.Globalization
+2007-01-25 Chris Toshok <toshok@ximian.com>
+
+ * Calendar.cs, HijriCalendar.cs, ThaiBuddhistCalendar.cs,
+ HebrewCalendar.cs, GregorianCalendar.cs, KoreanCalendar.cs,
+ JulianCalendar.cs, PersianCalendar.cs:
+
+ more serialization fixes. the M_TwoDigitYearMax field we use
+ appears to be called twoDigitYearMax in MS.NET. rename it (and
+ fix all the Calendar subclasses to use this naming). Likewise
+ with is_readonly (MS calls it m_isReadOnly).
+
+ Also, the m_currentEraValue field I had originally placed in
+ GregorianCalendar appears to be in Calendar (as running
+ nunit-2.2.8-2.0 shows.)
+
+ In GregorianCalendar, rename the M_CalendarType field to m_type
+ and remove the extra field I added.
+
+ The previous fix got nunit 2.4-2.0 running. This change gets
+ versions 2.2.8 and 2.4 of nunit running against both 1.1 and 2.0
+ profiles.
+
2006-01-24 Chris Toshok <toshok@ximian.com>
[ these fix nunit built with MS .net 2.0, running on mono. nunit
/// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
/// </summary>
[NonSerialized]
- internal GregorianCalendarTypes M_CalendarType;
+ internal GregorianCalendarTypes m_type;
/// <value>
/// The property stores the
/// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
/// </value>
public virtual GregorianCalendarTypes CalendarType {
- get { return M_CalendarType; }
+ get { return m_type; }
set {
CheckReadOnly ();
// mscorlib 1:0:3300:0 doesn't check anything here
- M_CalendarType = value;
+ m_type = value;
}
}
CalendarType = type;
M_AbbrEraNames = new string[] {"C.E."};
M_EraNames = new string[] {"Common Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2029;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 2029;
}
#if NET_2_0
return Max;
}
}
-
- private int m_type; // Unused, by MS serializes this
- private int m_currentEraValue; // Unused, by MS serializes this
#endif
/// <summary>
public HebrewCalendar() {
M_AbbrEraNames = new string[] {"A.M."};
M_EraNames = new string[] {"Anno Mundi"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 5790;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 5790;
}
/// <summary>
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>
public JulianCalendar() {
M_AbbrEraNames = new string[] {"C.E."};
M_EraNames = new string[] {"Common Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2029;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 2029;
}
/// <summary>
public KoreanCalendar() {
M_AbbrEraNames = new string[] {"K.C.E."};
M_EraNames = new string[] {"Korean Current Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 4362;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 4362;
}
/// <value>Overridden. Gives the eras supported by the
public PersianCalendar() {
M_AbbrEraNames = new string[] {"A.P."};
M_EraNames = new string[] {"Anno Persico"};
- if (M_TwoDigitYearMax == 99)
+ if (twoDigitYearMax == 99)
// FIXME: the .NET documentation does not mention the default value,
// This is the value mentioned in the .NET documentation example result.
- M_TwoDigitYearMax = 1410;
+ twoDigitYearMax = 1410;
}
/// <summary>
public ThaiBuddhistCalendar() {
M_AbbrEraNames = new string[] {"T.B.C.E."};
M_EraNames = new string[] {"ThaiBuddhist current era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2572;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 2572;
}
/// <value>Overridden. Gives the eras supported by the