/// <summary>
/// A protected method checking an
/// <see cref="F:AddHijriDate"/> adjusted fixed day number.
/// </summary>
/// <param name="param">A string giving the name of the parameter
/// to check.</param>
/// <param name="rdHijri">An integer giving the AddHijriDate adjusted
/// fixed day number.
/// </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// Exception is thrown, if the AddHijriDate adjusted fixed day
/// number is outside the supported range.
/// </exception>
internal void M_CheckFixedHijri(string param, int rdHijri)
{
if (rdHijri < M_MinFixed || rdHijri > M_MaxFixed - AddHijriDate)
{
StringWriter sw = new StringWriter();
int day, month, year;
CCHijriCalendar.dmy_from_fixed(out day, out month,
out year, M_MaxFixed - AddHijriDate);
if (AddHijriDate != 0)
{
sw.Write("This HijriCalendar " +
"(AddHijriDate {0})" +
" allows dates from 1. 1. 1 to " +
"{1}. {2}. {3}.",
AddHijriDate,
day, month, year);
}
else
{
sw.Write("HijriCalendar allows dates from " +
"1.1.1 to {0}.{1}.{2}.",
day, month, year);
}
throw new ArgumentOutOfRangeException(param,
sw.ToString());
}
}