GregorianCalendarTypes GregorianCalendarTypes GregorianCalendarTypes GregorianCalendarTypes Enum

정의

여러 언어 버전의 그레고리오력을 정의합니다.Defines the different language versions of the Gregorian calendar.

public enum class GregorianCalendarTypes
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum GregorianCalendarTypes
type GregorianCalendarTypes = 
Public Enum GregorianCalendarTypes
상속
GregorianCalendarTypesGregorianCalendarTypesGregorianCalendarTypesGregorianCalendarTypes
특성

필드

Arabic Arabic Arabic Arabic 10

아랍어 버전의 그레고리오력을 나타냅니다.Refers to the Arabic version of the Gregorian calendar.

Localized Localized Localized Localized 1

CultureInfo를 사용하는 DateTimeFormatInfo 언어를 기반으로 하는 지역화된 버전의 그레고리오력을 나타냅니다.Refers to the localized version of the Gregorian calendar, based on the language of the CultureInfo that uses the DateTimeFormatInfo.

MiddleEastFrench MiddleEastFrench MiddleEastFrench MiddleEastFrench 9

중동 프랑스어 버전의 그레고리오력을 나타냅니다.Refers to the Middle East French version of the Gregorian calendar.

TransliteratedEnglish TransliteratedEnglish TransliteratedEnglish TransliteratedEnglish 11

음역된 영어 버전의 그레고리오력을 나타냅니다.Refers to the transliterated English version of the Gregorian calendar.

TransliteratedFrench TransliteratedFrench TransliteratedFrench TransliteratedFrench 12

음역된 프랑스어 버전의 그레고리오력을 나타냅니다.Refers to the transliterated French version of the Gregorian calendar.

USEnglish USEnglish USEnglish USEnglish 2

미국 영어 버전의 그레고리오력을 나타냅니다.Refers to the U.S. English version of the Gregorian calendar.

예제

다음 코드 예제에서는 문화권에서 지 원하는 GregorianCalendar 언어 버전을 확인 하는 방법을 보여 줍니다.The following code example demonstrates how to determine the GregorianCalendar language version supported by the culture.

using namespace System;
using namespace System::Globalization;
using namespace System::Collections;
int main()
{
   
   // Calendar* myOptCals[] = new CultureInfo(S"ar-SA") -> OptionalCalendars;
   CultureInfo^ MyCI = gcnew CultureInfo( "ar-SA" );
   array<Calendar^>^myOptCals = MyCI->OptionalCalendars;
   
   // Checks which ones are GregorianCalendar then determines the GregorianCalendar version.
   Console::WriteLine( "The ar-SA culture supports the following calendars:" );
   IEnumerator^ myEnum = myOptCals->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Calendar^ cal = safe_cast<Calendar^>(myEnum->Current);
      if ( cal->GetType() == GregorianCalendar::typeid )
      {
         GregorianCalendar^ myGreCal = dynamic_cast<GregorianCalendar^>(cal);
         GregorianCalendarTypes calType = myGreCal->CalendarType;
         Console::WriteLine( " {0} ( {1})", cal, calType );
      }
      else
            Console::WriteLine( " {0}", cal );
   }
}

/*
This code produces the following output.

The ar-SA culture supports the following calendars:
 System.Globalization.HijriCalendar
 System.Globalization.GregorianCalendar ( USEnglish)
 System.Globalization.GregorianCalendar ( MiddleEastFrench)
 System.Globalization.GregorianCalendar ( Arabic)
 System.Globalization.GregorianCalendar ( Localized)
 System.Globalization.GregorianCalendar ( TransliteratedFrench)

*/
using System;
using System.Globalization;


public class SamplesCultureInfo  {

   public static void Main()  {

      // Gets the calendars supported by the ar-SA culture.
      Calendar[] myOptCals = new CultureInfo("ar-SA").OptionalCalendars;

      // Checks which ones are GregorianCalendar then determines the GregorianCalendar version.
      Console.WriteLine( "The ar-SA culture supports the following calendars:" );
      foreach ( Calendar cal in myOptCals )  {
         if ( cal.GetType() == typeof( GregorianCalendar ) )  {
            GregorianCalendar myGreCal = (GregorianCalendar) cal;
            GregorianCalendarTypes calType = myGreCal.CalendarType;
            Console.WriteLine( "   {0} ({1})", cal, calType );
         }
         else  {
            Console.WriteLine( "   {0}", cal );
         }
      }

   }

}

/*
This code produces the following output.

The ar-SA culture supports the following calendars:
   System.Globalization.HijriCalendar
   System.Globalization.GregorianCalendar (USEnglish)
   System.Globalization.GregorianCalendar (MiddleEastFrench)
   System.Globalization.GregorianCalendar (Arabic)
   System.Globalization.GregorianCalendar (Localized)
   System.Globalization.GregorianCalendar (TransliteratedFrench)

*/
Imports System
Imports System.Globalization

Public Class SamplesCultureInfo

   Public Shared Sub Main()

      ' Gets the calendars supported by the ar-SA culture.
      Dim myOptCals As Calendar() = New CultureInfo("ar-SA").OptionalCalendars

      ' Checks which ones are GregorianCalendar then determines the GregorianCalendar version.
      Console.WriteLine("The ar-SA culture supports the following calendars:")
      Dim cal As Calendar
      For Each cal In  myOptCals
         If cal.GetType() Is GetType(GregorianCalendar)  Then
            Dim myGreCal As GregorianCalendar = CType(cal, GregorianCalendar)
            Dim calType As GregorianCalendarTypes = myGreCal.CalendarType
            Console.WriteLine("   {0} ({1})", cal, calType)
         Else
            Console.WriteLine("   {0}", cal)
         End If
      Next cal

   End Sub 'Main 

End Class 'SamplesCultureInfo


'This code produces the following output.
'
'The ar-SA culture supports the following calendars:
'   System.Globalization.HijriCalendar
'   System.Globalization.GregorianCalendar (USEnglish)
'   System.Globalization.GregorianCalendar (MiddleEastFrench)
'   System.Globalization.GregorianCalendar (Arabic)
'   System.Globalization.GregorianCalendar (Localized)
'   System.Globalization.GregorianCalendar (TransliteratedFrench)

다음 코드 예제에서는 출력을 DateTime 를 사용 하 여는 GregorianCalendar 지역화 하는 합니다.The following code example prints a DateTime using a GregorianCalendar that is localized.

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes three different CultureInfo.
   CultureInfo^ myCIdeDE = gcnew CultureInfo( "de-DE",false );
   CultureInfo^ myCIenUS = gcnew CultureInfo( "en-US",false );
   CultureInfo^ myCIfrFR = gcnew CultureInfo( "fr-FR",false );
   CultureInfo^ myCIruRU = gcnew CultureInfo( "ru-RU",false );
   
   // Creates a Localized GregorianCalendar.
   // GregorianCalendarTypes::Localized is the default when using the GregorianCalendar constructor with->Item[Out] parameters.
   Calendar^ myCal = gcnew GregorianCalendar;
   
   // Sets the DateTimeFormatInfo::Calendar property to a Localized GregorianCalendar.
   // Localized GregorianCalendar is the default calendar for de-DE, en-US, and fr-FR,
   myCIruRU->DateTimeFormat->Calendar = myCal;
   
   // Creates a DateTime.
   DateTime myDT = DateTime(2002,1,3,13,30,45);
   
   // Displays the DateTime.
   Console::WriteLine( "de-DE: {0}", myDT.ToString( "F", myCIdeDE ) );
   Console::WriteLine( "en-US: {0}", myDT.ToString( "F", myCIenUS ) );
   Console::WriteLine( "fr-FR: {0}", myDT.ToString( "F", myCIfrFR ) );
   Console::WriteLine( "ru-RU: {0}", myDT.ToString( "F", myCIruRU ) );
}

/*
The example displays the following output:
   de-DE: Donnerstag, 3. Januar 2002 13:30:45
   en-US: Thursday, January 03, 2002 1:30:45 PM
   fr-FR: jeudi 3 janvier 2002 13:30:45
   ru-RU: 3 января 2002 г. 13:30:45
*/
using System;
using System.Globalization;


public class SamplesGregorianCalendar  {

   public static void Main()  {

      // Creates and initializes four different CultureInfo objects.
      CultureInfo myCIdeDE = new CultureInfo("de-DE", false);
      CultureInfo myCIenUS = new CultureInfo("en-US", false);
      CultureInfo myCIfrFR = new CultureInfo("fr-FR", false);
      CultureInfo myCIruRU = new CultureInfo("ru-RU", false);

      // Creates a Localized GregorianCalendar.
      // GregorianCalendarTypes.Localized is the default when using the GregorianCalendar constructor without parameters.
      Calendar myCal = new GregorianCalendar();

      // Sets the DateTimeFormatInfo.Calendar property to a Localized GregorianCalendar.
      // Localized GregorianCalendar is the default calendar for de-DE, en-US, and fr-FR,
      myCIruRU.DateTimeFormat.Calendar = myCal;

      // Creates a DateTime.
      DateTime myDT = new DateTime( 2002, 1, 3, 13, 30, 45 );

      // Displays the DateTime.
      Console.WriteLine( "de-DE: {0}", myDT.ToString( "F", myCIdeDE ) );
      Console.WriteLine( "en-US: {0}", myDT.ToString( "F", myCIenUS ) );
      Console.WriteLine( "fr-FR: {0}", myDT.ToString( "F", myCIfrFR ) );
      Console.WriteLine( "ru-RU: {0}", myDT.ToString( "F", myCIruRU ) );
   }
}
/*
The example displays the following output:
   de-DE: Donnerstag, 3. Januar 2002 13:30:45
   en-US: Thursday, January 03, 2002 1:30:45 PM
   fr-FR: jeudi 3 janvier 2002 13:30:45
   ru-RU: 3 января 2002 г. 13:30:45
*/
Imports System
Imports System.Globalization

Public Class SamplesGregorianCalendar

   Public Shared Sub Main()
      ' Creates and initializes three different CultureInfo.
      Dim myCIdeDE As New CultureInfo("de-DE", False)
      Dim myCIenUS As New CultureInfo("en-US", False)
      Dim myCIfrFR As New CultureInfo("fr-FR", False)
      Dim myCIruRU As New CultureInfo("ru-RU", False)

      ' Creates a Localized GregorianCalendar.
      ' GregorianCalendarTypes.Localized is the default when using the GregorianCalendar constructor without parameters.
      Dim myCal = New GregorianCalendar()

      ' Sets the DateTimeFormatInfo.Calendar property to a Localized GregorianCalendar.
      ' Localized GregorianCalendar is the default calendar for de-DE, en-US, and fr-FR,
      myCIruRU.DateTimeFormat.Calendar = myCal

      ' Creates a DateTime.
      Dim myDT As New DateTime(2002, 1, 3, 13, 30, 45)

      ' Displays the DateTime.
      Console.WriteLine("de-DE: {0}", myDT.ToString("F", myCIdeDE))
      Console.WriteLine("en-US: {0}", myDT.ToString("F", myCIenUS))
      Console.WriteLine("fr-FR: {0}", myDT.ToString("F", myCIfrFR))
      Console.WriteLine("ru-RU: {0}", myDT.ToString("F", myCIruRU))
   End Sub
End Class
' This example displays the following output:
'    de-DE: Donnerstag, 3. Januar 2002 13:30:45
'    en-US: Thursday, January 03, 2002 1:30:45 PM
'    fr-FR: jeudi 3 janvier 2002 13:30:45
'    ru-RU: 3 января 2002 г. 13:30:45

설명

와 연결 된 날짜 및 시간 패턴의 GregorianCalendar 언어에 따라 달라 집니다.The date and time patterns associated with the GregorianCalendar vary depending on the language. 경우는 GregorianCalendar 에서 선택한 DateTimeFormatInfo.CalendarGregorianCalendarTypes 을 사용 하는 날짜 및 시간 패턴을 지정 하려면 사용할 수 있습니다 DateTimeFormatInfo합니다.If the GregorianCalendar is selected in DateTimeFormatInfo.Calendar, GregorianCalendarTypes can be used to specify which date and time patterns to use in that DateTimeFormatInfo.

아랍어 문화권에 대 한 일반 달력의 자세한 언어 버전이 제공 됩니다.For Arabic cultures, more language versions of the Gregorian calendar are available. 예를 들어 프랑스어 버전의 따르면 GregorianCalendar MiddleEastFrench 값을 사용 합니다.For example, you can use the French version of GregorianCalendar using the MiddleEastFrench value.

지 원하는 문화권 MiddleEastFrench 의 모든 언어 버전을 지원 하지 않을 수 GregorianCalendar입니다.A culture that supports MiddleEastFrench might not support all language versions of GregorianCalendar. 합니다 CultureInfo.CalendarCultureInfo.OptionalCalendars 속성 해당 문화권에서 지원 되는 달력을 지정 합니다.The CultureInfo.Calendar and CultureInfo.OptionalCalendars properties specify the calendars supported by that culture. 하는 경우 GregorianCalendar 지원 됩니다 CalendarType 언어 버전을 확인 하기 위해 사용할 수 있습니다 CalendarType 지원 됩니다.If GregorianCalendar is supported, CalendarType can be used to determine which language versions of CalendarType are supported.

적용 대상