Sdílet prostřednictvím


CalendarAlgorithmType Výčet

Definice

Určuje, jestli je kalendář založený na slunečních, lunárních nebo lunisolarových nákresech.

public enum class CalendarAlgorithmType
public enum CalendarAlgorithmType
[System.Runtime.InteropServices.ComVisible(true)]
public enum CalendarAlgorithmType
type CalendarAlgorithmType = 
[<System.Runtime.InteropServices.ComVisible(true)>]
type CalendarAlgorithmType = 
Public Enum CalendarAlgorithmType
Dědičnost
CalendarAlgorithmType
Atributy

Pole

Name Hodnota Description
Unknown 0

Neznámý kalendářový základ.

SolarCalendar 1

Kalendář založený na sluneční soustavě.

LunarCalendar 2

Lunární kalendář.

LunisolarCalendar 3

Kalendář založený na lunisolaru.

Příklady

Následující příklad kódu ukazuje AlgorithmType vlastnost a CalendarAlgorithmType výčet.

// This example demonstrates the Calendar.AlgorithmType property and
// CalendarAlgorithmType enumeration.

using System;
using System.Globalization;

class Sample
{
    public static void Main()
    {
    GregorianCalendar grCal = new GregorianCalendar();
    HijriCalendar     hiCal = new HijriCalendar();
    JapaneseLunisolarCalendar
                      jaCal = new JapaneseLunisolarCalendar();
    Display(grCal);
    Display(hiCal);
    Display(jaCal);
    }

    static void Display(Calendar c)
    {
    string name = c.ToString().PadRight(50, '.');
    Console.WriteLine("{0} {1}", name, c.AlgorithmType);
    }
}
/*
This code example produces the following results:

System.Globalization.GregorianCalendar............ SolarCalendar
System.Globalization.HijriCalendar................ LunarCalendar
System.Globalization.JapaneseLunisolarCalendar.... LunisolarCalendar

*/
' This example demonstrates the Calendar.AlgorithmType property and
' CalendarAlgorithmType enumeration.
Imports System.Globalization

Class Sample
   Public Shared Sub Main()
      Dim grCal As New GregorianCalendar()
      Dim hiCal As New HijriCalendar()
      Dim jaCal As New JapaneseLunisolarCalendar()
      Display(grCal)
      Display(hiCal)
      Display(jaCal)
   End Sub
   
   Shared Sub Display(c As Calendar)
      Dim name As String = c.ToString().PadRight(50, "."c)
      Console.WriteLine("{0} {1}", name, c.AlgorithmType)
   End Sub
End Class
'
'This code example produces the following results:
'
'System.Globalization.GregorianCalendar............ SolarCalendar
'System.Globalization.HijriCalendar................ LunarCalendar
'System.Globalization.JapaneseLunisolarCalendar.... LunisolarCalendar
'

Poznámky

Výpočet data konkrétního kalendáře závisí na tom, jestli je kalendář založený na sluneční soustavě, lunárním nebo lunisolarovém. Například , a třídy jsou solární, HijriCalendar a UmAlQuraCalendar třídy jsou lunární a třídy jsou založené na lunárních a třídách JapaneseLunisolarCalendarHebrewCalendar jsou lunisolar-založené, takže používají sluneční výpočty pro rok a lunární výpočty pro měsíc a den.JulianCalendarJapaneseCalendarGregorianCalendar

Hodnota CalendarAlgorithmType , která je vrácena členem kalendáře, jako Calendar.AlgorithmType je například vlastnost, určuje základ pro určitý kalendář.

Platí pro