UmAlQuraCalendar.IsLeapYear(Int32, Int32) UmAlQuraCalendar.IsLeapYear(Int32, Int32) UmAlQuraCalendar.IsLeapYear(Int32, Int32) UmAlQuraCalendar.IsLeapYear(Int32, Int32) Method

定義

指定した時代 (年号) の指定した年が閏年かどうかを確認します。Determines whether the specified year in the specified era is a leap year.

public:
 override bool IsLeapYear(int year, int era);
public override bool IsLeapYear (int year, int era);
override this.IsLeapYear : int * int -> bool
Public Overrides Function IsLeapYear (year As Integer, era As Integer) As Boolean

パラメーター

year
Int32 Int32 Int32 Int32

年。A year.

era
Int32 Int32 Int32 Int32

時代 (年号)。An era. UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] または UmAlQuraEra を指定します。Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or UmAlQuraEra.

戻り値

指定した年が閏年である場合は true。それ以外の場合は falsetrue if the specified year is a leap year; otherwise, false.

例外

year または era がこの UmAlQuraCalendar クラスでサポートされている範囲外の値です。year or era is outside the range supported by the UmAlQuraCalendar class.

次の例は、10 年連続と呼び出しの日数を表示、IsLeapYearどの年が閏年を判断するメソッド。The following example lists the number of days in ten consecutive years and calls the IsLeapYear method to determine which years are leap years.

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      Calendar cal = new UmAlQuraCalendar();
      int currentYear = cal.GetYear(DateTime.Now);
      
      for (int year = currentYear; year <= currentYear + 9; year++)
         Console.WriteLine("{0:d4}: {1} days {2}", year, 
                           cal.GetDaysInYear(year, UmAlQuraCalendar.UmAlQuraEra), 
                           cal.IsLeapYear(year, UmAlQuraCalendar.UmAlQuraEra) ?
                              "(Leap Year)" : "");        
   }
}
// The example displays the following output:
//       1431: 354 days
//       1432: 354 days
//       1433: 355 days (Leap Year)
//       1434: 354 days
//       1435: 355 days (Leap Year)
//       1436: 354 days
//       1437: 354 days
//       1438: 354 days
//       1439: 355 days (Leap Year)
//       1440: 354 days
Imports System.Globalization

Module Example
   Public Sub Main()
      Dim cal As New UmAlQuraCalendar()
      Dim currentYear As Integer = cal.GetYear(Date.Now)
      
      For year As Integer = currentYear To currentYear + 9
         Console.WriteLine("{0:d4}: {1} days {2}", year, 
                           cal.GetDaysInYear(year, UmAlQuraCalendar.UmAlQuraEra), 
                           If(cal.IsLeapYear(year, UmAlQuraCalendar.UmAlQuraEra),
                              "(Leap Year)", ""))        
      Next   
   End Sub
End Module
' The example displays the following output:
'       1431: 354 days
'       1432: 354 days
'       1433: 355 days (Leap Year)
'       1434: 354 days
'       1435: 355 days (Leap Year)
'       1436: 354 days
'       1437: 354 days
'       1438: 354 days
'       1439: 355 days (Leap Year)
'       1440: 354 days

注釈

一般的な年は 354 日を備え、閏年が 355 日。A common year has 354 days and a leap year has 355 days.

適用対象