ThaiBuddhistCalendar.IsLeapMonth(Int32, Int32, Int32) Metodo

Definizione

Determina se il mese specificato nell'anno specificato nell'era specificata è un mese bisestile.

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

Parametri

year
Int32

Intero che rappresenta l'anno.

month
Int32

Intero compreso tra 1 e 12 che rappresenta il mese.

era
Int32

Intero che rappresenta l'era.

Valori restituiti

Questo metodo restituisce falsesempre , a meno che non venga sottoposto a override da una classe derivata.

Eccezioni

year non è compreso nell'intervallo supportato dal calendario.

oppure

month non è compreso nell'intervallo supportato dal calendario.

oppure

era non è compreso nell'intervallo supportato dal calendario.

Esempio

L'esempio seguente chiama IsLeapMonth tutti i mesi in cinque anni nell'era corrente.

using System;
using System.Globalization;

public class SamplesThaiBuddhistCalendar  {

   public static void Main()  {

      // Creates and initializes a ThaiBuddhistCalendar.
      ThaiBuddhistCalendar myCal = new ThaiBuddhistCalendar();

      // Checks all the months in five years in the current era.
      int iMonthsInYear;
      for ( int y = 2544; y <= 2548; y++ )  {
         Console.Write( "{0}:\t", y );
         iMonthsInYear = myCal.GetMonthsInYear( y, ThaiBuddhistCalendar.CurrentEra );
         for ( int m = 1; m <= iMonthsInYear; m++ )
            Console.Write( "\t{0}", myCal.IsLeapMonth( y, m, ThaiBuddhistCalendar.CurrentEra ) );
         Console.WriteLine();
      }
   }
}

/*
This code produces the following output.

2544:           False   False   False   False   False   False   False   False   False   False   False   False
2545:           False   False   False   False   False   False   False   False   False   False   False   False
2546:           False   False   False   False   False   False   False   False   False   False   False   False
2547:           False   False   False   False   False   False   False   False   False   False   False   False
2548:           False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesThaiBuddhistCalendar   
   
   Public Shared Sub Main()

      ' Creates and initializes a ThaiBuddhistCalendar.
      Dim myCal As New ThaiBuddhistCalendar()

      ' Checks all the months in five years in the current era.
      Dim iMonthsInYear As Integer
      Dim y As Integer
      For y = 2544 To 2548
         Console.Write("{0}:" + ControlChars.Tab, y)
         iMonthsInYear = myCal.GetMonthsInYear(y, ThaiBuddhistCalendar.CurrentEra)
         Dim m As Integer
         For m = 1 To iMonthsInYear
            Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapMonth(y, m, ThaiBuddhistCalendar.CurrentEra))
         Next m
         Console.WriteLine()
      Next y

   End Sub

End Class


'This code produces the following output.
'
'2544:           False   False   False   False   False   False   False   False   False   False   False   False
'2545:           False   False   False   False   False   False   False   False   False   False   False   False
'2546:           False   False   False   False   False   False   False   False   False   False   False   False
'2547:           False   False   False   False   False   False   False   False   False   False   False   False
'2548:           False   False   False   False   False   False   False   False   False   False   False   False

Commenti

Gli anni bisestili nel calendario buddista thai corrispondono agli stessi anni bisestili nel calendario gregoriano. Un anno bisestile nel calendario gregoriano è definito come anno gregoriano che è divisibile in modo uniforme per quattro, tranne se è divisibile per 100. Tuttavia, gli anni gregoriani divisibili per 400 sono anni bisestili. Un anno comune ha 365 giorni e un anno bisestile ha 366 giorni.

Un mese bisestile è un mese intero che si verifica solo in un anno bisestile. Il calendario buddista thai non ha mesi intercalari.

Si applica a

Vedi anche