CalendarAlgorithmType Wyliczenie

Definicja

Określa, czy Kalendarz jest oparty na formacie słonecznym, opartym na procesorach lub księżycowo-słoneczny.Specifies whether a calendar is solar-based, lunar-based, or lunisolar-based.

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
Dziedziczenie
CalendarAlgorithmType
Atrybuty

Pola

LunarCalendar 2

Kalendarz oparty na księżycach.A lunar-based calendar.

LunisolarCalendar 3

Kalendarz oparty na księżycowo-słoneczny.A lunisolar-based calendar.

SolarCalendar 1

Kalendarz słoneczny.A solar-based calendar.

Unknown 0

Nieznana podstawa kalendarza.An unknown calendar basis.

Przykłady

Poniższy przykład kodu demonstruje AlgorithmType Właściwość i CalendarAlgorithmType Wyliczenie.The following code example demonstrates the AlgorithmType property and the CalendarAlgorithmType enumeration.

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
'

Uwagi

Obliczanie daty dla określonego kalendarza zależy od tego, czy Kalendarz jest oparty na danych słonecznych, opartych na procesorze księżycowym czy na księżycowo-słoneczny.A date calculation for a particular calendar depends on whether the calendar is solar-based, lunar-based, or lunisolar-based. Na przykład,, GregorianCalendar JapaneseCalendar i JulianCalendar klasy są oparte na słonecznym, HijriCalendar klasy i są oparte na procesorze UmAlQuraCalendar księżycowym, a HebrewCalendar klasy i JapaneseLunisolarCalendar są oparte na księżycowo-słoneczny, a tym samym przy użyciu obliczeń słonecznych w przypadku obliczeń na rok i dzień.For example, the GregorianCalendar, JapaneseCalendar, and JulianCalendar classes are solar-based, the HijriCalendar and UmAlQuraCalendar classes are lunar-based,.and the HebrewCalendar and JapaneseLunisolarCalendar classes are lunisolar-based, thus using solar calculations for the year and lunar calculations for the month and day.

CalendarAlgorithmTypeWartość, która jest zwracana przez element członkowski kalendarza, taki jak Calendar.AlgorithmType Właściwość, określa podstawę dla określonego kalendarza.A CalendarAlgorithmType value, which is returned by a calendar member such as the Calendar.AlgorithmType property, specifies the foundation for a particular calendar.

Dotyczy