CalendarAlgorithmType Enumeration

Definition

Gibt an, ob ein Kalender auf der Sonne, auf dem Mond oder sowohl auf dem Mond als auch auf der Sonne basiert.

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
Vererbung
CalendarAlgorithmType
Attribute

Felder

LunarCalendar 2

Ein Kalender auf der Grundlage des Mondes.

LunisolarCalendar 3

Ein Kalender auf der Grundlage des Mondes und der Sonne.

SolarCalendar 1

Ein Kalender auf der Grundlage der Sonne.

Unknown 0

Eine Kalender mit unbekannter Grundlage.

Beispiele

Im folgenden Codebeispiel werden die AlgorithmType Eigenschaft und die CalendarAlgorithmType Enumeration veranschaulicht.

using namespace System;
using namespace System::Globalization;

namespace CalendarTypeExample
{
    static void Display(Calendar^ genericCalendar)
    {
        String^ calendarName = 
            genericCalendar->ToString()->PadRight(50, '.');
        Console::WriteLine("{0} {1}", calendarName, genericCalendar->GetType());
    }
}

int main() 
{
    GregorianCalendar^ gregorianCalendar = gcnew GregorianCalendar();
    HijriCalendar^ hijriCalendar = gcnew HijriCalendar();
    JapaneseLunisolarCalendar^ japaneseCalendar = 
        gcnew JapaneseLunisolarCalendar();
    CalendarTypeExample::Display(gregorianCalendar);
    CalendarTypeExample::Display(hijriCalendar);
    CalendarTypeExample::Display(japaneseCalendar);
    return 0;
}

/* This code example produces the following output.

System.Globalization.GregorianCalendar............ System.Globalization.GregorianCalendar
System.Globalization.HijriCalendar................ System.Globalization.HijriCalendar
System.Globalization.JapaneseLunisolarCalendar.... System.Globalization.JapaneseLunisolarCalendar

*/
// 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
'

Hinweise

Eine Datumsberechnung für einen bestimmten Kalender hängt davon ab, ob der Kalender solar-, mond- oder lunisolarbasiert ist. Beispielsweise sind die GregorianCalendarKlassen , JapaneseCalendar, und JulianCalendar solarbasiert, die HijriCalendar Klassen und UmAlQuraCalendar sind mondbasiert, und die HebrewCalendar Klassen und JapaneseLunisolarCalendar sind lunisolarbasiert, sodass Sonnenberechnungen für das Jahr und Mondberechnungen für den Monat und den Tag verwendet werden.

Ein CalendarAlgorithmType Wert, der von einem Kalenderelement wie der Calendar.AlgorithmType -Eigenschaft zurückgegeben wird, gibt die Grundlage für einen bestimmten Kalender an.

Gilt für: