DateTimeFormatInfo.AbbreviatedMonthGenitiveNames 속성

정의

현재 DateTimeFormatInfo 개체와 연결된 약식 월 이름의 문자열 배열을 가져오거나 설정합니다.

public:
 property cli::array <System::String ^> ^ AbbreviatedMonthGenitiveNames { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[] AbbreviatedMonthGenitiveNames { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public string[] AbbreviatedMonthGenitiveNames { get; set; }
member this.AbbreviatedMonthGenitiveNames : string[] with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.AbbreviatedMonthGenitiveNames : string[] with get, set
Public Property AbbreviatedMonthGenitiveNames As String()

속성 값

String[]

약식 월 이름의 배열입니다.

특성

예외

set 작업에서 배열이 다차원이거나 길이가 정확히 13이 아닙니다.

set 작업에서 배열 또는 배열의 요소 중 하나가 null인 경우

set 작업에서 현재 DateTimeFormatInfo 개체가 읽기 전용인 경우

예제

다음 예제에서는 영어(미국) 문화권을 나타내는 읽기/쓰기 CultureInfo 개체를 만들고 축약된 genitive 월 이름을 및 AbbreviatedMonthNamesAbbreviatedMonthGenitiveNames 속성에 할당합니다. 그런 다음 문화권의 지원되는 달력에 각 월의 축약된 월 이름을 포함하는 날짜의 문자열 표현을 표시합니다.

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      CultureInfo ci = CultureInfo.CreateSpecificCulture("en-US");
      DateTimeFormatInfo dtfi = ci.DateTimeFormat;
      dtfi.AbbreviatedMonthNames = new string[] { "of Jan", "of Feb", "of Mar",
                                                  "of Apr", "of May", "of Jun",
                                                  "of Jul", "of Aug", "of Sep",
                                                  "of Oct", "of Nov", "of Dec", "" };
      dtfi.AbbreviatedMonthGenitiveNames = dtfi.AbbreviatedMonthNames;
      DateTime dat = new DateTime(2012, 5, 28);

      for (int ctr = 0; ctr < dtfi.Calendar.GetMonthsInYear(dat.Year); ctr++)
         Console.WriteLine(dat.AddMonths(ctr).ToString("dd MMM yyyy", dtfi));
   }
}
// The example displays the following output:
//       28 of May 2012
//       28 of Jun 2012
//       28 of Jul 2012
//       28 of Aug 2012
//       28 of Sep 2012
//       28 of Oct 2012
//       28 of Nov 2012
//       28 of Dec 2012
//       28 of Jan 2013
//       28 of Feb 2013
//       28 of Mar 2013
//       28 of Apr 2013
Imports System.Globalization

Module Example
   Public Sub Main()
      Dim ci As CultureInfo = CultureInfo.CreateSpecificCulture("en-US")
      Dim dtfi As DateTimeFormatInfo = ci.DateTimeFormat
      dtfi.AbbreviatedMonthNames = { "of Jan", "of Feb", "of Mar", 
                                     "of Apr", "of May", "of Jun", 
                                     "of Jul", "of Aug", "of Sep", 
                                     "of Oct", "of Nov", "of Dec", "" }  
      dtfi.AbbreviatedMonthGenitiveNames = dtfi.AbbreviatedMonthNames
      Dim dat As Date = #05/28/2012#
      
      For ctr As Integer = 0 To dtfi.Calendar.GetMonthsInYear(dat.Year) - 1
         Console.WriteLine(dat.AddMonths(ctr).ToString("dd MMM yyyy", dtfi))
      Next
   End Sub
End Module
' The example displays the following output:
'       28 of May 2012
'       28 of Jun 2012
'       28 of Jul 2012
'       28 of Aug 2012
'       28 of Sep 2012
'       28 of Oct 2012
'       28 of Nov 2012
'       28 of Dec 2012
'       28 of Jan 2013
'       28 of Feb 2013
'       28 of Mar 2013
'       28 of Apr 2013

설명

일부 언어에서는 날짜의 일부인 월 이름이 genitive 사례에 나타납니다. 예를 들어 ru-RU 또는 러시아어(러시아) 문화권의 날짜는 일 번호와 1 Января(1월 1일)와 같은 genitive 월 이름으로 구성됩니다. 이러한 문화권의 경우 사용자 지정 형식 문자열에 "MMM" 형식 지정자가 DateTime.ToString 포함된 경우 또는 ToString 메서드는 결과 문자열의 "MMM" 대신 배열의 AbbreviatedMonthGenitiveNames 적절한 멤버를 포함합니다.

개체는 13개월의 달력을 수용하기 때문에 Calendar 집합 작업에서 배열은 정확히 13개의 요소가 있는 1차원이어야 합니다. 12개월이 되는 달력의 경우 13번째 요소는 이어야 String.Empty합니다. 첫 번째 요소(인덱스 0의 요소)는 속성에 정의된 연도의 첫 번째 달을 Calendar 나타냅니다.

설정 하는 경우는 AbbreviatedMonthGenitiveNames 속성도 설정 AbbreviatedMonthNames 해야 합니다 속성입니다.

적용 대상

추가 정보