public static void Main()
    {
        // Creates and initializes a HijriCalendar.
        HijriCalendar myCal = new HijriCalendar();

        // Displays the header.
        Console.Write("YEAR\t");
        for (int y = 1421; y <= 1425; y++)
        {
            Console.Write("\t{0}", y);
        }
        Console.WriteLine();

        // Displays the value of the CurrentEra property.
        Console.Write("CurrentEra:");
        for (int y = 1421; y <= 1425; y++)
        {
            Console.Write("\t{0}", myCal.GetDaysInYear(y, HijriCalendar.CurrentEra));
        }
        Console.WriteLine();

        // Displays the values in the Eras property.
        for (int i = 0; i < myCal.Eras.Length; i++)
        {
            Console.Write("Era {0}:\t", myCal.Eras[i]);
            for (int y = 1421; y <= 1425; y++)
            {
                Console.Write("\t{0}", myCal.GetDaysInYear(y, myCal.Eras[i]));
            }
            Console.WriteLine();
        }
    }
Esempio n. 2
0
 /// <summary>
 /// Gets the number of days in th specified year of the current era.
 /// </summary>
 /// <param name="year">An integer representing year.</param>
 /// <returns></returns>
 public int GetDaysInYear(int year)
 {
     return(hc.GetDaysInYear(year));
 }