Nyelv

CalendarAlgorithmType Enumeráció

Definíció

Megadja, hogy egy naptár napalapú, holdalapú vagy lunisoláris alapú-e.

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
Öröklődés
CalendarAlgorithmType
Attribútumok

Mezők

Name Érték Description
Unknown 0

Ismeretlen naptáralap.

SolarCalendar 1

Egy napalapú naptár.

LunarCalendar 2

Holdalapú naptár.

LunisolarCalendar 3

Lunisolar-alapú naptár.

Példák

Az alábbi példakód a tulajdonságot és az AlgorithmType enumerálást CalendarAlgorithmType mutatja be.

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

Megjegyzések

Egy adott naptár dátumszámítása attól függ, hogy a naptár napalapú, holdalapú vagy lunisoláris alapú-e. A , GregorianCalendarés az osztályok például JapaneseCalendarnapalapúak, az JulianCalendarHijriCalendar osztályok holdalapúak,.és az UmAlQuraCalendarHebrewCalendar osztályok lunisoláris alapúak, így napszámításokat használnak az évre és a holdszámításokra a hónapra és a napra JapaneseLunisolarCalendar vonatkozóan.

Egy CalendarAlgorithmType olyan érték, amelyet egy naptártag, például a Calendar.AlgorithmType tulajdonság ad vissza, meghatározza egy adott naptár alapjait.

A következőre érvényes: