本文整理匯總了C#中System.Globalization.UmAlQuraCalendar.GetDaysInYear方法的典型用法代碼示例。如果您正苦於以下問題:C# UmAlQuraCalendar.GetDaysInYear方法的具體用法?C# UmAlQuraCalendar.GetDaysInYear怎麽用?C# UmAlQuraCalendar.GetDaysInYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了UmAlQuraCalendar.GetDaysInYear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
//引入命名空間
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
Calendar cal = new UmAlQuraCalendar();
int currentYear = cal.GetYear(DateTime.Now);
Console.WriteLine("Era Year Days\n");
foreach (int era in cal.Eras) {
for (int year = currentYear; year <= currentYear + 9; year++) {
Console.WriteLine("{0}{1} {2} {3}",
ShowCurrentEra(cal, era), era, year,
cal.GetDaysInYear(year, era));
}
}
Console.WriteLine("\n * Indicates the current era.");
}
private static string ShowCurrentEra(Calendar cal, int era)
{
if (era == cal.Eras[Calendar.CurrentEra])
return "*";
else
return " ";
}
}
輸出:
Era Year Days *1 1431 354 *1 1432 354 *1 1433 355 *1 1434 354 *1 1435 355 *1 1436 354 *1 1437 354 *1 1438 354 *1 1439 355 *1 1440 354 * Indicates the current era.