Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DateTimeFormatInfo.cs
Go to the documentation of this file.
4
6
8{
9 internal sealed class TokenHashValue
10 {
11 internal string tokenString;
12
14
15 internal int tokenValue;
16
18 {
19 this.tokenString = tokenString;
20 this.tokenType = tokenType;
21 this.tokenValue = tokenValue;
22 }
23 }
24
25 private static volatile DateTimeFormatInfo s_invariantInfo;
26
27 private readonly CultureData _cultureData;
28
29 private string _name;
30
31 private string _langName;
32
34
36
37 private string amDesignator;
38
39 private string pmDesignator;
40
41 private string dateSeparator;
42
44
45 private string generalLongTimePattern;
46
47 private string timeSeparator;
48
49 private string monthDayPattern;
50
51 private string dateTimeOffsetPattern;
52
54
55 private int firstDayOfWeek = -1;
56
57 private int calendarWeekRule = -1;
58
59 private string fullDateTimePattern;
60
61 private string[] abbreviatedDayNames;
62
63 private string[] m_superShortDayNames;
64
65 private string[] dayNames;
66
67 private string[] abbreviatedMonthNames;
68
69 private string[] monthNames;
70
71 private string[] genitiveMonthNames;
72
74
75 private string[] leapYearMonthNames;
76
77 private string longDatePattern;
78
79 private string shortDatePattern;
80
81 private string yearMonthPattern;
82
83 private string longTimePattern;
84
85 private string shortTimePattern;
86
87 private string[] allYearMonthPatterns;
88
89 private string[] allShortDatePatterns;
90
91 private string[] allLongDatePatterns;
92
93 private string[] allShortTimePatterns;
94
95 private string[] allLongTimePatterns;
96
97 private string[] m_eraNames;
98
99 private string[] m_abbrevEraNames;
100
101 private string[] m_abbrevEnglishEraNames;
102
104
105 internal bool _isReadOnly;
106
108
109 private string _decimalSeparator;
110
112
114
116
117 private static volatile DateTimeFormatInfo s_jajpDTFI;
118
119 private static volatile DateTimeFormatInfo s_zhtwDTFI;
120
122
124
126
128 {
129 get
130 {
131 if (s_invariantInfo == null)
132 {
134 dateTimeFormatInfo.Calendar.SetReadOnlyState(readOnly: true);
135 dateTimeFormatInfo._isReadOnly = true;
137 }
138 return s_invariantInfo;
139 }
140 }
141
143 {
144 get
145 {
147 if (!currentCulture._isInherited)
148 {
150 if (dateTimeInfo != null)
151 {
152 return dateTimeInfo;
153 }
154 }
156 }
157 }
158
159 public string AMDesignator
160 {
161 get
162 {
163 if (amDesignator == null)
164 {
166 }
167 return amDesignator;
168 }
169 set
170 {
171 if (IsReadOnly)
172 {
174 }
175 if (value == null)
176 {
177 throw new ArgumentNullException("value");
178 }
181 }
182 }
183
185 {
186 get
187 {
188 return calendar;
189 }
190 [MemberNotNull("calendar")]
191 set
192 {
193 if (IsReadOnly)
194 {
196 }
197 if (value == null)
198 {
199 throw new ArgumentNullException("value");
200 }
201 if (value == calendar)
202 {
203 return;
204 }
205 for (int i = 0; i < OptionalCalendars.Length; i++)
206 {
207 if (OptionalCalendars[i] == value.ID)
208 {
209 if (calendar != null)
210 {
211 m_eraNames = null;
212 m_abbrevEraNames = null;
214 monthDayPattern = null;
215 dayNames = null;
216 abbreviatedDayNames = null;
218 monthNames = null;
220 genitiveMonthNames = null;
222 leapYearMonthNames = null;
223 formatFlags = DateTimeFormatFlags.NotInitialized;
225 allLongDatePatterns = null;
228 longDatePattern = null;
229 shortDatePattern = null;
230 yearMonthPattern = null;
231 fullDateTimePattern = null;
234 dateSeparator = null;
236 }
237 calendar = value;
239 return;
240 }
241 }
243 }
244 }
245
247
249
251
253 {
254 get
255 {
256 if (m_abbrevEnglishEraNames == null)
257 {
259 }
261 }
262 }
263
264 public string DateSeparator
265 {
266 get
267 {
268 if (dateSeparator == null)
269 {
271 }
272 return dateSeparator;
273 }
274 set
275 {
276 if (IsReadOnly)
277 {
279 }
280 if (value == null)
281 {
282 throw new ArgumentNullException("value");
283 }
286 }
287 }
288
290 {
291 get
292 {
293 if (firstDayOfWeek == -1)
294 {
296 }
298 }
299 set
300 {
301 if (IsReadOnly)
302 {
304 }
306 {
308 }
309 firstDayOfWeek = (int)value;
310 }
311 }
312
314 {
315 get
316 {
317 if (calendarWeekRule == -1)
318 {
320 }
322 }
323 set
324 {
325 if (IsReadOnly)
326 {
328 }
330 {
332 }
333 calendarWeekRule = (int)value;
334 }
335 }
336
338 {
339 get
340 {
342 }
343 set
344 {
345 if (IsReadOnly)
346 {
348 }
349 if (value == null)
350 {
351 throw new ArgumentNullException("value");
352 }
354 }
355 }
356
357 public string LongDatePattern
358 {
359 get
360 {
362 }
363 set
364 {
365 if (IsReadOnly)
366 {
368 }
369 if (value == null)
370 {
371 throw new ArgumentNullException("value");
372 }
375 }
376 }
377
378 public string LongTimePattern
379 {
380 get
381 {
383 }
384 set
385 {
386 if (IsReadOnly)
387 {
389 }
390 if (value == null)
391 {
392 throw new ArgumentNullException("value");
393 }
396 }
397 }
398
399 public string MonthDayPattern
400 {
401 get
402 {
403 if (monthDayPattern == null)
404 {
406 }
407 return monthDayPattern;
408 }
409 set
410 {
411 if (IsReadOnly)
412 {
414 }
415 if (value == null)
416 {
417 throw new ArgumentNullException("value");
418 }
420 }
421 }
422
423 public string PMDesignator
424 {
425 get
426 {
427 if (pmDesignator == null)
428 {
430 }
431 return pmDesignator;
432 }
433 set
434 {
435 if (IsReadOnly)
436 {
438 }
439 if (value == null)
440 {
441 throw new ArgumentNullException("value");
442 }
445 }
446 }
447
448 public string RFC1123Pattern => "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
449
450 public string ShortDatePattern
451 {
452 get
453 {
455 }
456 set
457 {
458 if (IsReadOnly)
459 {
461 }
462 if (value == null)
463 {
464 throw new ArgumentNullException("value");
465 }
468 }
469 }
470
471 public string ShortTimePattern
472 {
473 get
474 {
476 }
477 set
478 {
479 if (IsReadOnly)
480 {
482 }
483 if (value == null)
484 {
485 throw new ArgumentNullException("value");
486 }
489 }
490 }
491
492 public string SortableDateTimePattern => "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
493
495
497
498 internal string DateTimeOffsetPattern
499 {
500 get
501 {
502 if (dateTimeOffsetPattern == null)
503 {
504 bool flag = false;
505 bool flag2 = false;
506 char c = '\'';
507 int num = 0;
508 while (!flag && num < LongTimePattern.Length)
509 {
510 switch (LongTimePattern[num])
511 {
512 case 'z':
513 flag = !flag2;
514 break;
515 case '"':
516 case '\'':
517 if (flag2 && c == LongTimePattern[num])
518 {
519 flag2 = false;
520 }
521 else if (!flag2)
522 {
523 c = LongTimePattern[num];
524 flag2 = true;
525 }
526 break;
527 case '%':
528 case '\\':
529 num++;
530 break;
531 }
532 num++;
533 }
535 }
537 }
538 }
539
540 public string TimeSeparator
541 {
542 get
543 {
544 if (timeSeparator == null)
545 {
547 }
548 return timeSeparator;
549 }
550 set
551 {
552 if (IsReadOnly)
553 {
555 }
556 if (value == null)
557 {
558 throw new ArgumentNullException("value");
559 }
562 }
563 }
564
565 public string UniversalSortableDateTimePattern => "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
566
567 public string YearMonthPattern
568 {
569 get
570 {
572 }
573 set
574 {
575 if (IsReadOnly)
576 {
578 }
579 if (value == null)
580 {
581 throw new ArgumentNullException("value");
582 }
585 }
586 }
587
588 public string[] AbbreviatedDayNames
589 {
590 get
591 {
592 return (string[])InternalGetAbbreviatedDayOfWeekNames().Clone();
593 }
594 set
595 {
596 if (IsReadOnly)
597 {
599 }
600 if (value == null)
601 {
602 throw new ArgumentNullException("value");
603 }
604 if (value.Length != 7)
605 {
607 }
608 CheckNullValue(value, value.Length);
611 }
612 }
613
614 public string[] ShortestDayNames
615 {
616 get
617 {
618 return (string[])InternalGetSuperShortDayNames().Clone();
619 }
620 set
621 {
622 if (IsReadOnly)
623 {
625 }
626 if (value == null)
627 {
628 throw new ArgumentNullException("value");
629 }
630 if (value.Length != 7)
631 {
633 }
634 CheckNullValue(value, value.Length);
636 }
637 }
638
639 public string[] DayNames
640 {
641 get
642 {
643 return (string[])InternalGetDayOfWeekNames().Clone();
644 }
645 set
646 {
647 if (IsReadOnly)
648 {
650 }
651 if (value == null)
652 {
653 throw new ArgumentNullException("value");
654 }
655 if (value.Length != 7)
656 {
658 }
659 CheckNullValue(value, value.Length);
661 dayNames = value;
662 }
663 }
664
665 public string[] AbbreviatedMonthNames
666 {
667 get
668 {
669 return (string[])InternalGetAbbreviatedMonthNames().Clone();
670 }
671 set
672 {
673 if (IsReadOnly)
674 {
676 }
677 if (value == null)
678 {
679 throw new ArgumentNullException("value");
680 }
681 if (value.Length != 13)
682 {
684 }
685 CheckNullValue(value, value.Length - 1);
688 }
689 }
690
691 public string[] MonthNames
692 {
693 get
694 {
695 return (string[])InternalGetMonthNames().Clone();
696 }
697 set
698 {
699 if (IsReadOnly)
700 {
702 }
703 if (value == null)
704 {
705 throw new ArgumentNullException("value");
706 }
707 if (value.Length != 13)
708 {
710 }
711 CheckNullValue(value, value.Length - 1);
714 }
715 }
716
717 internal bool HasSpacesInMonthNames => (FormatFlags & DateTimeFormatFlags.UseSpacesInMonthNames) != 0;
718
719 internal bool HasSpacesInDayNames => (FormatFlags & DateTimeFormatFlags.UseSpacesInDayNames) != 0;
720
722
724
726
728
730
731 private string[] UnclonedYearMonthPatterns
732 {
733 get
734 {
735 if (allYearMonthPatterns == null)
736 {
738 }
740 }
741 }
742
743 private string[] UnclonedShortDatePatterns
744 {
745 get
746 {
747 if (allShortDatePatterns == null)
748 {
750 }
752 }
753 }
754
755 private string[] UnclonedLongDatePatterns
756 {
757 get
758 {
759 if (allLongDatePatterns == null)
760 {
762 }
763 return allLongDatePatterns;
764 }
765 }
766
767 private string[] UnclonedShortTimePatterns
768 {
769 get
770 {
771 if (allShortTimePatterns == null)
772 {
774 }
776 }
777 }
778
779 private string[] UnclonedLongTimePatterns
780 {
781 get
782 {
783 if (allLongTimePatterns == null)
784 {
786 }
787 return allLongTimePatterns;
788 }
789 }
790
791 public bool IsReadOnly => _isReadOnly;
792
794
795 public string[] AbbreviatedMonthGenitiveNames
796 {
797 get
798 {
800 }
801 set
802 {
803 if (IsReadOnly)
804 {
806 }
807 if (value == null)
808 {
809 throw new ArgumentNullException("value");
810 }
811 if (value.Length != 13)
812 {
814 }
815 CheckNullValue(value, value.Length - 1);
818 }
819 }
820
821 public string[] MonthGenitiveNames
822 {
823 get
824 {
826 }
827 set
828 {
829 if (IsReadOnly)
830 {
832 }
833 if (value == null)
834 {
835 throw new ArgumentNullException("value");
836 }
837 if (value.Length != 13)
838 {
840 }
841 CheckNullValue(value, value.Length - 1);
844 }
845 }
846
847 internal string DecimalSeparator => _decimalSeparator ?? (_decimalSeparator = new NumberFormatInfo(_cultureData.UseUserOverride ? CultureData.GetCultureData(_cultureData.CultureName, useUserOverride: false) : _cultureData).NumberDecimalSeparator);
848
849 internal string FullTimeSpanPositivePattern => _fullTimeSpanPositivePattern ?? (_fullTimeSpanPositivePattern = "d':'h':'mm':'ss'" + DecimalSeparator + "'FFFFFFF");
850
852
854
855 internal DateTimeFormatFlags FormatFlags
856 {
857 get
858 {
859 if (formatFlags == DateTimeFormatFlags.NotInitialized)
860 {
861 return InitializeFormatFlags();
862 }
863 return formatFlags;
864 }
865 }
866
867 internal bool HasForceTwoDigitYears
868 {
869 get
870 {
872 if (iD - 3 <= CalendarId.GREGORIAN)
873 {
874 return true;
875 }
876 return false;
877 }
878 }
879
880 internal bool HasYearMonthAdjustment => (FormatFlags & DateTimeFormatFlags.UseHebrewRule) != 0;
881
882 private string[] InternalGetAbbreviatedDayOfWeekNames()
883 {
885 }
886
887 [MethodImpl(MethodImplOptions.NoInlining)]
889 {
891 return abbreviatedDayNames;
892 }
893
894 private string[] InternalGetSuperShortDayNames()
895 {
897 }
898
899 [MethodImpl(MethodImplOptions.NoInlining)]
900 private string[] InternalGetSuperShortDayNamesCore()
901 {
904 }
905
906 private string[] InternalGetDayOfWeekNames()
907 {
909 }
910
911 [MethodImpl(MethodImplOptions.NoInlining)]
912 private string[] InternalGetDayOfWeekNamesCore()
913 {
915 return dayNames;
916 }
917
918 private string[] InternalGetAbbreviatedMonthNames()
919 {
921 }
922
923 [MethodImpl(MethodImplOptions.NoInlining)]
924 private string[] InternalGetAbbreviatedMonthNamesCore()
925 {
928 }
929
930 private string[] InternalGetMonthNames()
931 {
933 }
934
935 [MethodImpl(MethodImplOptions.NoInlining)]
936 private string[] internalGetMonthNamesCore()
937 {
939 return monthNames;
940 }
941
942 public DateTimeFormatInfo()
943 : this(CultureInfo.InvariantCulture._cultureData, GregorianCalendar.GetDefaultInstance())
944 {
945 }
946
947 internal DateTimeFormatInfo(CultureData cultureData, Calendar cal)
948 {
950 calendar = cal;
952 }
953
955 {
956 if (firstDayOfWeek == -1)
957 {
958 firstDayOfWeek = cultureData.FirstDayOfWeek;
959 }
960 if (calendarWeekRule == -1)
961 {
962 calendarWeekRule = cultureData.CalendarWeekRule;
963 }
964 if (amDesignator == null)
965 {
966 amDesignator = cultureData.AMDesignator;
967 }
968 if (pmDesignator == null)
969 {
970 pmDesignator = cultureData.PMDesignator;
971 }
972 if (timeSeparator == null)
973 {
974 timeSeparator = cultureData.TimeSeparator;
975 }
976 if (dateSeparator == null)
977 {
978 dateSeparator = cultureData.DateSeparator(calendarId);
979 }
985 }
986
987 public static DateTimeFormatInfo GetInstance(IFormatProvider? provider)
988 {
989 if (provider != null)
990 {
991 if (!(provider is CultureInfo { _isInherited: false } cultureInfo))
992 {
993 if (!(provider is DateTimeFormatInfo result))
994 {
995 if (!(provider.GetFormat(typeof(DateTimeFormatInfo)) is DateTimeFormatInfo result2))
996 {
997 return CurrentInfo;
998 }
999 return result2;
1000 }
1001 return result;
1002 }
1003 return cultureInfo.DateTimeFormat;
1004 }
1005 return CurrentInfo;
1006 }
1007
1008 public object? GetFormat(Type? formatType)
1009 {
1010 if (!(formatType == typeof(DateTimeFormatInfo)))
1011 {
1012 return null;
1013 }
1014 return this;
1015 }
1016
1017 public object Clone()
1018 {
1019 DateTimeFormatInfo dateTimeFormatInfo = (DateTimeFormatInfo)MemberwiseClone();
1020 dateTimeFormatInfo.calendar = (Calendar)Calendar.Clone();
1021 dateTimeFormatInfo._isReadOnly = false;
1022 return dateTimeFormatInfo;
1023 }
1024
1025 public int GetEra(string eraName)
1026 {
1027 if (eraName == null)
1028 {
1029 throw new ArgumentNullException("eraName");
1030 }
1031 if (eraName.Length == 0)
1032 {
1033 return -1;
1034 }
1035 for (int i = 0; i < EraNames.Length; i++)
1036 {
1037 if (m_eraNames[i].Length > 0 && Culture.CompareInfo.Compare(eraName, m_eraNames[i], CompareOptions.IgnoreCase) == 0)
1038 {
1039 return i + 1;
1040 }
1041 }
1042 for (int j = 0; j < AbbreviatedEraNames.Length; j++)
1043 {
1044 if (Culture.CompareInfo.Compare(eraName, m_abbrevEraNames[j], CompareOptions.IgnoreCase) == 0)
1045 {
1046 return j + 1;
1047 }
1048 }
1049 for (int k = 0; k < AbbreviatedEnglishEraNames.Length; k++)
1050 {
1051 if (System.Globalization.CompareInfo.Invariant.Compare(eraName, m_abbrevEnglishEraNames[k], CompareOptions.IgnoreCase) == 0)
1052 {
1053 return k + 1;
1054 }
1055 }
1056 return -1;
1057 }
1058
1059 public string GetEraName(int era)
1060 {
1061 if (era == 0)
1062 {
1064 }
1066 {
1067 return m_eraNames[era];
1068 }
1070 }
1071
1072 public string GetAbbreviatedEraName(int era)
1073 {
1074 if (AbbreviatedEraNames.Length == 0)
1075 {
1076 return GetEraName(era);
1077 }
1078 if (era == 0)
1079 {
1081 }
1083 {
1084 return m_abbrevEraNames[era];
1085 }
1087 }
1088
1089 private void OnLongDatePatternChanged()
1090 {
1092 fullDateTimePattern = null;
1093 }
1094
1095 private void OnLongTimePatternChanged()
1096 {
1098 fullDateTimePattern = null;
1100 dateTimeOffsetPattern = null;
1101 }
1102
1103 private void OnShortDatePatternChanged()
1104 {
1108 dateTimeOffsetPattern = null;
1109 }
1110
1111 private void OnShortTimePatternChanged()
1112 {
1115 }
1116
1117 private void OnYearMonthPatternChanged()
1118 {
1120 }
1121
1122 private static void CheckNullValue(string[] values, int length)
1123 {
1124 for (int i = 0; i < length; i++)
1125 {
1126 if (values[i] == null)
1127 {
1129 }
1130 }
1131 }
1132
1133 internal string InternalGetMonthName(int month, MonthNameStyles style, bool abbreviated)
1134 {
1135 string[] array = style switch
1136 {
1137 MonthNameStyles.Genitive => InternalGetGenitiveMonthNames(abbreviated),
1138 MonthNameStyles.LeapYear => InternalGetLeapYearMonthNames(),
1140 };
1141 if (month < 1 || month > array.Length)
1142 {
1143 throw new ArgumentOutOfRangeException("month", month, SR.Format(SR.ArgumentOutOfRange_Range, 1, array.Length));
1144 }
1145 return array[month - 1];
1146 }
1147
1148 private string[] InternalGetGenitiveMonthNames(bool abbreviated)
1149 {
1150 if (abbreviated)
1151 {
1153 {
1155 }
1157 }
1158 if (genitiveMonthNames == null)
1159 {
1161 }
1162 return genitiveMonthNames;
1163 }
1164
1165 internal string[] InternalGetLeapYearMonthNames()
1166 {
1167 if (leapYearMonthNames == null)
1168 {
1170 }
1171 return leapYearMonthNames;
1172 }
1173
1175 {
1177 {
1179 }
1181 }
1182
1183 public string GetShortestDayName(DayOfWeek dayOfWeek)
1184 {
1186 {
1187 throw new ArgumentOutOfRangeException("dayOfWeek", dayOfWeek, SR.Format(SR.ArgumentOutOfRange_Range, DayOfWeek.Sunday, DayOfWeek.Saturday));
1188 }
1189 return InternalGetSuperShortDayNames()[(int)dayOfWeek];
1190 }
1191
1192 private static string[] GetCombinedPatterns(string[] patterns1, string[] patterns2, string connectString)
1193 {
1194 string[] array = new string[patterns1.Length * patterns2.Length];
1195 int num = 0;
1196 for (int i = 0; i < patterns1.Length; i++)
1197 {
1198 for (int j = 0; j < patterns2.Length; j++)
1199 {
1200 array[num++] = patterns1[i] + connectString + patterns2[j];
1201 }
1202 }
1203 return array;
1204 }
1205
1206 public string[] GetAllDateTimePatterns()
1207 {
1208 List<string> list = new List<string>(132);
1209 for (int i = 0; i < DateTimeFormat.allStandardFormats.Length; i++)
1210 {
1212 for (int j = 0; j < allDateTimePatterns.Length; j++)
1213 {
1215 }
1216 }
1217 return list.ToArray();
1218 }
1219
1220 public string[] GetAllDateTimePatterns(char format)
1221 {
1222 switch (format)
1223 {
1224 case 'd':
1225 return AllShortDatePatterns;
1226 case 'D':
1227 return AllLongDatePatterns;
1228 case 'f':
1230 case 'F':
1231 case 'U':
1233 case 'g':
1235 case 'G':
1237 case 'M':
1238 case 'm':
1239 return new string[1] { MonthDayPattern };
1240 case 'O':
1241 case 'o':
1242 return new string[1] { "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK" };
1243 case 'R':
1244 case 'r':
1245 return new string[1] { "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'" };
1246 case 's':
1247 return new string[1] { "yyyy'-'MM'-'dd'T'HH':'mm':'ss" };
1248 case 't':
1249 return AllShortTimePatterns;
1250 case 'T':
1251 return AllLongTimePatterns;
1252 case 'u':
1253 return new string[1] { UniversalSortableDateTimePattern };
1254 case 'Y':
1255 case 'y':
1256 return AllYearMonthPatterns;
1257 default:
1259 }
1260 }
1261
1262 public string GetDayName(DayOfWeek dayofweek)
1263 {
1265 {
1267 }
1268 return InternalGetDayOfWeekNames()[(int)dayofweek];
1269 }
1270
1271 public string GetAbbreviatedMonthName(int month)
1272 {
1273 if (month < 1 || month > 13)
1274 {
1275 throw new ArgumentOutOfRangeException("month", month, SR.Format(SR.ArgumentOutOfRange_Range, 1, 13));
1276 }
1277 return InternalGetAbbreviatedMonthNames()[month - 1];
1278 }
1279
1280 public string GetMonthName(int month)
1281 {
1282 if (month < 1 || month > 13)
1283 {
1284 throw new ArgumentOutOfRangeException("month", month, SR.Format(SR.ArgumentOutOfRange_Range, 1, 13));
1285 }
1286 return InternalGetMonthNames()[month - 1];
1287 }
1288
1289 private static string[] GetMergedPatterns(string[] patterns, string defaultPattern)
1290 {
1291 if (defaultPattern == patterns[0])
1292 {
1293 return (string[])patterns.Clone();
1294 }
1295 int i;
1296 for (i = 0; i < patterns.Length && !(defaultPattern == patterns[i]); i++)
1297 {
1298 }
1299 string[] array;
1300 if (i < patterns.Length)
1301 {
1302 array = (string[])patterns.Clone();
1303 array[i] = array[0];
1304 }
1305 else
1306 {
1307 array = new string[patterns.Length + 1];
1308 Array.Copy(patterns, 0, array, 1, patterns.Length);
1309 }
1310 array[0] = defaultPattern;
1311 return array;
1312 }
1313
1314 public static DateTimeFormatInfo ReadOnly(DateTimeFormatInfo dtfi)
1315 {
1316 if (dtfi == null)
1317 {
1318 throw new ArgumentNullException("dtfi");
1319 }
1320 if (dtfi.IsReadOnly)
1321 {
1322 return dtfi;
1323 }
1324 DateTimeFormatInfo dateTimeFormatInfo = (DateTimeFormatInfo)dtfi.MemberwiseClone();
1325 dateTimeFormatInfo.calendar = System.Globalization.Calendar.ReadOnly(dtfi.Calendar);
1326 dateTimeFormatInfo._isReadOnly = true;
1327 return dateTimeFormatInfo;
1328 }
1329
1330 public void SetAllDateTimePatterns(string[] patterns, char format)
1331 {
1332 if (IsReadOnly)
1333 {
1335 }
1336 if (patterns == null)
1337 {
1338 throw new ArgumentNullException("patterns");
1339 }
1340 if (patterns.Length == 0)
1341 {
1342 throw new ArgumentException(SR.Arg_ArrayZeroError, "patterns");
1343 }
1344 for (int i = 0; i < patterns.Length; i++)
1345 {
1346 if (patterns[i] == null)
1347 {
1348 throw new ArgumentNullException("patterns[" + i + "]", SR.ArgumentNull_ArrayValue);
1349 }
1350 }
1351 switch (format)
1352 {
1353 case 'd':
1357 break;
1358 case 'D':
1362 break;
1363 case 't':
1367 break;
1368 case 'T':
1372 break;
1373 case 'Y':
1374 case 'y':
1378 break;
1379 default:
1381 }
1382 }
1383
1384 internal static void ValidateStyles(DateTimeStyles style, bool styles = false)
1385 {
1386 if (((uint)style & 0xFFFFFF00u) != 0 || (style & (DateTimeStyles.AssumeLocal | DateTimeStyles.AssumeUniversal)) == (DateTimeStyles.AssumeLocal | DateTimeStyles.AssumeUniversal) || (style & (DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeLocal | DateTimeStyles.AssumeUniversal | DateTimeStyles.RoundtripKind)) > DateTimeStyles.RoundtripKind)
1387 {
1388 ThrowInvalid(style, styles);
1389 }
1390 static void ThrowInvalid(DateTimeStyles style, bool styles)
1391 {
1392 string message = ((((uint)style & 0xFFFFFF00u) != 0) ? SR.Argument_InvalidDateTimeStyles : (((style & (DateTimeStyles.AssumeLocal | DateTimeStyles.AssumeUniversal)) == (DateTimeStyles.AssumeLocal | DateTimeStyles.AssumeUniversal)) ? SR.Argument_ConflictingDateTimeStyles : SR.Argument_ConflictingDateTimeRoundtripStyles));
1393 throw new ArgumentException(message, styles ? "styles" : "style");
1394 }
1395 }
1396
1397 [MethodImpl(MethodImplOptions.NoInlining)]
1398 private DateTimeFormatFlags InitializeFormatFlags()
1399 {
1400 formatFlags = (DateTimeFormatFlags)(DateTimeFormatInfoScanner.GetFormatFlagGenitiveMonth(MonthNames, InternalGetGenitiveMonthNames(abbreviated: false), AbbreviatedMonthNames, InternalGetGenitiveMonthNames(abbreviated: true)) | DateTimeFormatInfoScanner.GetFormatFlagUseSpaceInMonthNames(MonthNames, InternalGetGenitiveMonthNames(abbreviated: false), AbbreviatedMonthNames, InternalGetGenitiveMonthNames(abbreviated: true)) | DateTimeFormatInfoScanner.GetFormatFlagUseSpaceInDayNames(DayNames, AbbreviatedDayNames) | DateTimeFormatInfoScanner.GetFormatFlagUseHebrewCalendar((int)Calendar.ID));
1401 return formatFlags;
1402 }
1403
1404 internal bool YearMonthAdjustment(ref int year, ref int month, bool parsedMonthName)
1405 {
1406 if ((FormatFlags & DateTimeFormatFlags.UseHebrewRule) != 0)
1407 {
1408 if (year < 1000)
1409 {
1410 year += 5000;
1411 }
1413 {
1414 return false;
1415 }
1417 {
1418 if (month >= 8)
1419 {
1420 month--;
1421 }
1422 else if (month == 7)
1423 {
1424 return false;
1425 }
1426 }
1427 }
1428 return true;
1429 }
1430
1431 internal static DateTimeFormatInfo GetJapaneseCalendarDTFI()
1432 {
1433 DateTimeFormatInfo dateTimeFormat = s_jajpDTFI;
1434 if (dateTimeFormat == null)
1435 {
1436 dateTimeFormat = new CultureInfo("ja-JP", useUserOverride: false).DateTimeFormat;
1437 dateTimeFormat.Calendar = JapaneseCalendar.GetDefaultInstance();
1439 }
1440 return dateTimeFormat;
1441 }
1442
1443 internal static DateTimeFormatInfo GetTaiwanCalendarDTFI()
1444 {
1445 DateTimeFormatInfo dateTimeFormat = s_zhtwDTFI;
1446 if (dateTimeFormat == null)
1447 {
1448 dateTimeFormat = new CultureInfo("zh-TW", useUserOverride: false).DateTimeFormat;
1449 dateTimeFormat.Calendar = TaiwanCalendar.GetDefaultInstance();
1451 }
1452 return dateTimeFormat;
1453 }
1454
1455 private void ClearTokenHashTable()
1456 {
1457 _dtfiTokenHash = null;
1458 formatFlags = DateTimeFormatFlags.NotInitialized;
1459 }
1460
1461 internal TokenHashValue[] CreateTokenHashTable()
1462 {
1463 TokenHashValue[] array = _dtfiTokenHash;
1464 if (array == null)
1465 {
1466 array = new TokenHashValue[199];
1467 string text = TimeSeparator.Trim();
1468 if ("," != text)
1469 {
1470 InsertHash(array, ",", TokenType.IgnorableSymbol, 0);
1471 }
1472 if ("." != text)
1473 {
1474 InsertHash(array, ".", TokenType.IgnorableSymbol, 0);
1475 }
1476 if ("시" != text && "時" != text && "时" != text)
1477 {
1478 InsertHash(array, TimeSeparator, TokenType.SEP_Time, 0);
1479 }
1480 if (_name == "fr-CA")
1481 {
1482 InsertHash(array, " h", TokenType.SEP_HourSuff, 0);
1483 InsertHash(array, " h ", TokenType.SEP_HourSuff, 0);
1484 InsertHash(array, " min", TokenType.SEP_MinuteSuff, 0);
1485 InsertHash(array, " min ", TokenType.SEP_MinuteSuff, 0);
1486 InsertHash(array, " s", TokenType.SEP_SecondSuff, 0);
1487 InsertHash(array, " s ", TokenType.SEP_SecondSuff, 0);
1488 }
1489 InsertHash(array, AMDesignator, (TokenType)1027, 0);
1490 InsertHash(array, PMDesignator, (TokenType)1284, 1);
1491 if (LanguageName.Equals("sq"))
1492 {
1493 InsertHash(array, "." + AMDesignator, (TokenType)1027, 0);
1494 InsertHash(array, "." + PMDesignator, (TokenType)1284, 1);
1495 }
1496 InsertHash(array, "年", TokenType.SEP_YearSuff, 0);
1497 InsertHash(array, "년", TokenType.SEP_YearSuff, 0);
1498 InsertHash(array, "月", TokenType.SEP_MonthSuff, 0);
1499 InsertHash(array, "월", TokenType.SEP_MonthSuff, 0);
1500 InsertHash(array, "日", TokenType.SEP_DaySuff, 0);
1501 InsertHash(array, "일", TokenType.SEP_DaySuff, 0);
1502 InsertHash(array, "時", TokenType.SEP_HourSuff, 0);
1503 InsertHash(array, "时", TokenType.SEP_HourSuff, 0);
1504 InsertHash(array, "分", TokenType.SEP_MinuteSuff, 0);
1505 InsertHash(array, "秒", TokenType.SEP_SecondSuff, 0);
1507 {
1508 InsertHash(array, "元", TokenType.YearNumberToken, 1);
1509 InsertHash(array, "(", TokenType.IgnorableSymbol, 0);
1510 InsertHash(array, ")", TokenType.IgnorableSymbol, 0);
1511 }
1512 if (LanguageName.Equals("ko"))
1513 {
1514 InsertHash(array, "시", TokenType.SEP_HourSuff, 0);
1515 InsertHash(array, "분", TokenType.SEP_MinuteSuff, 0);
1516 InsertHash(array, "초", TokenType.SEP_SecondSuff, 0);
1517 }
1518 if (LanguageName.Equals("ky"))
1519 {
1520 InsertHash(array, "-", TokenType.IgnorableSymbol, 0);
1521 }
1522 else
1523 {
1524 InsertHash(array, "-", TokenType.SEP_DateOrOffset, 0);
1525 }
1526 DateTimeFormatInfoScanner dateTimeFormatInfoScanner = new DateTimeFormatInfoScanner();
1527 string[] dateWordsOfDTFI = dateTimeFormatInfoScanner.GetDateWordsOfDTFI(this);
1528 _ = FormatFlags;
1529 bool flag = false;
1530 if (dateWordsOfDTFI != null)
1531 {
1532 for (int i = 0; i < dateWordsOfDTFI.Length; i++)
1533 {
1534 switch (dateWordsOfDTFI[i][0])
1535 {
1536 case '\ue000':
1537 {
1540 break;
1541 }
1542 case '\ue001':
1543 {
1544 string text2 = dateWordsOfDTFI[i].Substring(1);
1545 InsertHash(array, text2, TokenType.IgnorableSymbol, 0);
1546 if (DateSeparator.Trim().Equals(text2))
1547 {
1548 flag = true;
1549 }
1550 break;
1551 }
1552 default:
1553 InsertHash(array, dateWordsOfDTFI[i], TokenType.DateWordToken, 0);
1554 if (LanguageName.Equals("eu"))
1555 {
1556 InsertHash(array, "." + dateWordsOfDTFI[i], TokenType.DateWordToken, 0);
1557 }
1558 break;
1559 }
1560 }
1561 }
1562 if (!flag)
1563 {
1564 InsertHash(array, DateSeparator, TokenType.SEP_Date, 0);
1565 }
1567 for (int j = 1; j <= 13; j++)
1568 {
1569 InsertHash(array, GetAbbreviatedMonthName(j), TokenType.MonthToken, j);
1570 }
1571 if ((FormatFlags & DateTimeFormatFlags.UseGenitiveMonth) != 0)
1572 {
1575 for (int k = 1; k <= 13; k++)
1576 {
1577 InsertHash(array, array2[k - 1], TokenType.MonthToken, k);
1578 InsertHash(array, array3[k - 1], TokenType.MonthToken, k);
1579 }
1580 }
1581 if ((FormatFlags & DateTimeFormatFlags.UseLeapYearMonth) != 0)
1582 {
1583 for (int l = 1; l <= 13; l++)
1584 {
1586 InsertHash(array, str, TokenType.MonthToken, l);
1587 }
1588 }
1589 for (int m = 0; m < 7; m++)
1590 {
1591 string dayName = GetDayName((DayOfWeek)m);
1592 InsertHash(array, dayName, TokenType.DayOfWeekToken, m);
1594 InsertHash(array, dayName, TokenType.DayOfWeekToken, m);
1595 }
1596 int[] eras = calendar.Eras;
1597 for (int n = 1; n <= eras.Length; n++)
1598 {
1599 InsertHash(array, GetEraName(n), TokenType.EraToken, n);
1600 InsertHash(array, GetAbbreviatedEraName(n), TokenType.EraToken, n);
1601 }
1602 if (!GlobalizationMode.Invariant)
1603 {
1604 if (LanguageName.Equals("ja"))
1605 {
1606 for (int num = 0; num < 7; num++)
1607 {
1608 string str2 = "(" + GetAbbreviatedDayName((DayOfWeek)num) + ")";
1609 InsertHash(array, str2, TokenType.DayOfWeekToken, num);
1610 }
1611 if (Calendar.GetType() != typeof(JapaneseCalendar))
1612 {
1613 DateTimeFormatInfo japaneseCalendarDTFI = GetJapaneseCalendarDTFI();
1614 for (int num2 = 1; num2 <= japaneseCalendarDTFI.Calendar.Eras.Length; num2++)
1615 {
1616 InsertHash(array, japaneseCalendarDTFI.GetEraName(num2), TokenType.JapaneseEraToken, num2);
1617 InsertHash(array, japaneseCalendarDTFI.GetAbbreviatedEraName(num2), TokenType.JapaneseEraToken, num2);
1618 InsertHash(array, japaneseCalendarDTFI.AbbreviatedEnglishEraNames[num2 - 1], TokenType.JapaneseEraToken, num2);
1619 }
1620 }
1621 }
1622 else if (CultureName.Equals("zh-TW"))
1623 {
1624 DateTimeFormatInfo taiwanCalendarDTFI = GetTaiwanCalendarDTFI();
1625 for (int num3 = 1; num3 <= taiwanCalendarDTFI.Calendar.Eras.Length; num3++)
1626 {
1627 if (taiwanCalendarDTFI.GetEraName(num3).Length > 0)
1628 {
1629 InsertHash(array, taiwanCalendarDTFI.GetEraName(num3), TokenType.TEraToken, num3);
1630 }
1631 }
1632 }
1633 }
1634 InsertHash(array, InvariantInfo.AMDesignator, (TokenType)1027, 0);
1635 InsertHash(array, InvariantInfo.PMDesignator, (TokenType)1284, 1);
1636 for (int num4 = 1; num4 <= 12; num4++)
1637 {
1638 string monthName = InvariantInfo.GetMonthName(num4);
1639 InsertHash(array, monthName, TokenType.MonthToken, num4);
1640 monthName = InvariantInfo.GetAbbreviatedMonthName(num4);
1641 InsertHash(array, monthName, TokenType.MonthToken, num4);
1642 }
1643 for (int num5 = 0; num5 < 7; num5++)
1644 {
1645 string dayName2 = InvariantInfo.GetDayName((DayOfWeek)num5);
1646 InsertHash(array, dayName2, TokenType.DayOfWeekToken, num5);
1647 dayName2 = InvariantInfo.GetAbbreviatedDayName((DayOfWeek)num5);
1648 InsertHash(array, dayName2, TokenType.DayOfWeekToken, num5);
1649 }
1650 for (int num6 = 0; num6 < AbbreviatedEnglishEraNames.Length; num6++)
1651 {
1652 InsertHash(array, AbbreviatedEnglishEraNames[num6], TokenType.EraToken, num6 + 1);
1653 }
1654 InsertHash(array, "T", TokenType.SEP_LocalTimeMark, 0);
1655 InsertHash(array, "GMT", TokenType.TimeZoneToken, 0);
1656 InsertHash(array, "Z", TokenType.TimeZoneToken, 0);
1657 InsertHash(array, "/", TokenType.SEP_Date, 0);
1658 InsertHash(array, ":", TokenType.SEP_Time, 0);
1660 }
1661 return array;
1662 }
1663
1664 private void AddMonthNames(TokenHashValue[] temp, ReadOnlySpan<char> monthPostfix = default(ReadOnlySpan<char>))
1665 {
1666 for (int i = 1; i <= 13; i++)
1667 {
1668 string monthName = GetMonthName(i);
1669 if (monthName.Length > 0)
1670 {
1671 if (!monthPostfix.IsEmpty)
1672 {
1673 InsertHash(temp, monthName + monthPostfix, TokenType.MonthToken, i);
1674 }
1675 else
1676 {
1677 InsertHash(temp, monthName, TokenType.MonthToken, i);
1678 }
1679 }
1681 InsertHash(temp, monthName, TokenType.MonthToken, i);
1682 }
1683 }
1684
1685 private static bool TryParseHebrewNumber(ref __DTString str, out bool badFormat, out int number)
1686 {
1687 number = -1;
1688 badFormat = false;
1689 int index = str.Index;
1690 if (!HebrewNumber.IsDigit(str.Value[index]))
1691 {
1692 return false;
1693 }
1694 HebrewNumberParsingContext context = new HebrewNumberParsingContext(0);
1696 do
1697 {
1698 hebrewNumberParsingState = HebrewNumber.ParseByChar(str.Value[index++], ref context);
1699 if ((uint)hebrewNumberParsingState <= 1u)
1700 {
1701 return false;
1702 }
1703 }
1704 while (index < str.Value.Length && hebrewNumberParsingState != HebrewNumberParsingState.FoundEndOfHebrewNumber);
1705 if (hebrewNumberParsingState != HebrewNumberParsingState.FoundEndOfHebrewNumber)
1706 {
1707 return false;
1708 }
1709 str.Advance(index - str.Index);
1710 number = context.result;
1711 return true;
1712 }
1713
1714 private static bool IsHebrewChar(char ch)
1715 {
1716 if (ch >= '\u0590')
1717 {
1718 return ch <= '\u05ff';
1719 }
1720 return false;
1721 }
1722
1723 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1724 private bool IsAllowedJapaneseTokenFollowedByNonSpaceLetter(string tokenString, char nextCh)
1725 {
1726 if (!LocalAppContextSwitches.EnforceLegacyJapaneseDateParsing && Calendar.ID == CalendarId.JAPAN && (nextCh == "元"[0] || (tokenString == "元" && nextCh == "年"[0])))
1727 {
1728 return true;
1729 }
1730 return false;
1731 }
1732
1733 internal bool Tokenize(TokenType TokenMask, out TokenType tokenType, out int tokenValue, ref __DTString str)
1734 {
1735 tokenType = TokenType.UnknownToken;
1736 tokenValue = 0;
1737 char c = str.m_current;
1738 bool flag = char.IsLetter(c);
1739 if (flag)
1740 {
1741 c = Culture.TextInfo.ToLower(c);
1742 if (!GlobalizationMode.Invariant && IsHebrewChar(c) && TokenMask == TokenType.RegularTokenMask && TryParseHebrewNumber(ref str, out var badFormat, out tokenValue))
1743 {
1744 if (badFormat)
1745 {
1746 tokenType = TokenType.UnknownToken;
1747 return false;
1748 }
1749 tokenType = TokenType.HebrewNumber;
1750 return true;
1751 }
1752 }
1753 int num = c % 199;
1754 int num2 = 1 + c % 197;
1755 int num3 = str.Length - str.Index;
1756 int num4 = 0;
1757 TokenHashValue[] array = _dtfiTokenHash ?? CreateTokenHashTable();
1758 do
1759 {
1760 TokenHashValue tokenHashValue = array[num];
1761 if (tokenHashValue == null)
1762 {
1763 break;
1764 }
1765 if ((tokenHashValue.tokenType & TokenMask) > (TokenType)0 && tokenHashValue.tokenString.Length <= num3)
1766 {
1767 bool flag2 = true;
1768 if (flag)
1769 {
1770 int num5 = str.Index + tokenHashValue.tokenString.Length;
1771 if (num5 > str.Length)
1772 {
1773 flag2 = false;
1774 }
1775 else if (num5 < str.Length)
1776 {
1777 char c2 = str.Value[num5];
1778 flag2 = !char.IsLetter(c2) || IsAllowedJapaneseTokenFollowedByNonSpaceLetter(tokenHashValue.tokenString, c2);
1779 }
1780 }
1781 if (flag2 && ((tokenHashValue.tokenString.Length == 1 && str.Value[str.Index] == tokenHashValue.tokenString[0]) || Culture.CompareInfo.Compare(str.Value.Slice(str.Index, tokenHashValue.tokenString.Length), tokenHashValue.tokenString, CompareOptions.IgnoreCase) == 0))
1782 {
1783 tokenType = tokenHashValue.tokenType & TokenMask;
1784 tokenValue = tokenHashValue.tokenValue;
1785 str.Advance(tokenHashValue.tokenString.Length);
1786 return true;
1787 }
1788 if ((tokenHashValue.tokenType == TokenType.MonthToken && HasSpacesInMonthNames) || (tokenHashValue.tokenType == TokenType.DayOfWeekToken && HasSpacesInDayNames))
1789 {
1790 int matchLength = 0;
1791 if (str.MatchSpecifiedWords(tokenHashValue.tokenString, checkWordBoundary: true, ref matchLength))
1792 {
1793 tokenType = tokenHashValue.tokenType & TokenMask;
1794 tokenValue = tokenHashValue.tokenValue;
1795 str.Advance(matchLength);
1796 return true;
1797 }
1798 }
1799 }
1800 num4++;
1801 num += num2;
1802 if (num >= 199)
1803 {
1804 num -= 199;
1805 }
1806 }
1807 while (num4 < 199);
1808 return false;
1809 }
1810
1811 private void InsertAtCurrentHashNode(TokenHashValue[] hashTable, string str, char ch, TokenType tokenType, int tokenValue, int pos, int hashcode, int hashProbe)
1812 {
1813 TokenHashValue tokenHashValue = hashTable[hashcode];
1814 hashTable[hashcode] = new TokenHashValue(str, tokenType, tokenValue);
1815 while (++pos < 199)
1816 {
1818 if (hashcode >= 199)
1819 {
1820 hashcode -= 199;
1821 }
1822 TokenHashValue tokenHashValue2 = hashTable[hashcode];
1823 if (tokenHashValue2 == null || Culture.TextInfo.ToLower(tokenHashValue2.tokenString[0]) == ch)
1824 {
1826 if (tokenHashValue2 == null)
1827 {
1828 break;
1829 }
1831 }
1832 }
1833 }
1834
1835 private void InsertHash(TokenHashValue[] hashTable, string str, TokenType tokenType, int tokenValue)
1836 {
1837 if (string.IsNullOrEmpty(str))
1838 {
1839 return;
1840 }
1841 int num = 0;
1842 if (char.IsWhiteSpace(str[0]) || char.IsWhiteSpace(str[^1]))
1843 {
1844 str = str.Trim();
1845 if (str.Length == 0)
1846 {
1847 return;
1848 }
1849 }
1850 char c = Culture.TextInfo.ToLower(str[0]);
1851 int num2 = c % 199;
1852 int num3 = 1 + c % 197;
1853 do
1854 {
1855 TokenHashValue tokenHashValue = hashTable[num2];
1856 if (tokenHashValue == null)
1857 {
1858 hashTable[num2] = new TokenHashValue(str, tokenType, tokenValue);
1859 break;
1860 }
1861 if (str.Length >= tokenHashValue.tokenString.Length && CompareStringIgnoreCaseOptimized(str, 0, tokenHashValue.tokenString.Length, tokenHashValue.tokenString, 0, tokenHashValue.tokenString.Length))
1862 {
1863 if (str.Length > tokenHashValue.tokenString.Length)
1864 {
1865 InsertAtCurrentHashNode(hashTable, str, c, tokenType, tokenValue, num, num2, num3);
1866 break;
1867 }
1868 int tokenType2 = (int)tokenHashValue.tokenType;
1869 if (((tokenType2 & 0xFF) == 0 && (tokenType & TokenType.RegularTokenMask) != 0) || ((tokenType2 & 0xFF00) == 0 && (tokenType & TokenType.SeparatorTokenMask) != 0))
1870 {
1871 tokenHashValue.tokenType |= tokenType;
1872 if (tokenValue != 0)
1873 {
1874 tokenHashValue.tokenValue = tokenValue;
1875 }
1876 }
1877 break;
1878 }
1879 num++;
1880 num2 += num3;
1881 if (num2 >= 199)
1882 {
1883 num2 -= 199;
1884 }
1885 }
1886 while (num < 199);
1887 }
1888
1889 private bool CompareStringIgnoreCaseOptimized(string string1, int offset1, int length1, string string2, int offset2, int length2)
1890 {
1891 if (length1 == 1 && length2 == 1 && string1[offset1] == string2[offset2])
1892 {
1893 return true;
1894 }
1895 return Culture.CompareInfo.Compare(string1, offset1, length1, string2, offset2, length2, CompareOptions.IgnoreCase) == 0;
1896 }
1897}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
bool ICollection< KeyValuePair< TKey, TValue > >. IsReadOnly
static char[] allStandardFormats
virtual object Clone()
Definition Calendar.cs:54
static Calendar ReadOnly(Calendar calendar)
Definition Calendar.cs:61
virtual DateTime MaxSupportedDateTime
Definition Calendar.cs:15
virtual bool IsLeapYear(int year)
Definition Calendar.cs:297
int GetYear(DateTime time)
virtual DateTime MinSupportedDateTime
Definition Calendar.cs:13
virtual CalendarId ID
Definition Calendar.cs:19
static readonly CompareInfo Invariant
static CompareInfo GetCompareInfo(int culture, Assembly assembly)
string[] AbbreviatedMonthNames(CalendarId calendarId)
string CalendarName(CalendarId calendarId)
string[] YearMonths(CalendarId calendarId)
string[] DayNames(CalendarId calendarId)
string[] ShortDates(CalendarId calendarId)
string[] AbbrevEraNames(CalendarId calendarId)
string DateSeparator(CalendarId calendarId)
string[] AbbreviatedGenitiveMonthNames(CalendarId calendarId)
string MonthDay(CalendarId calendarId)
string[] AbbreviatedDayNames(CalendarId calendarId)
string[] LongDates(CalendarId calendarId)
string[] AbbreviatedEnglishEraNames(CalendarId calendarId)
string[] LeapYearMonthNames(CalendarId calendarId)
string[] GenitiveMonthNames(CalendarId calendarId)
string[] EraNames(CalendarId calendarId)
string[] SuperShortDayNames(CalendarId calendarId)
string[] MonthNames(CalendarId calendarId)
virtual CompareInfo CompareInfo
static CultureInfo CurrentCulture
static CultureInfo GetCultureInfo(int culture)
TokenHashValue(string tokenString, TokenType tokenType, int tokenValue)
static volatile DateTimeFormatInfo s_jajpDTFI
static volatile DateTimeFormatInfo s_invariantInfo
static volatile DateTimeFormatInfo s_zhtwDTFI
static string ArgumentOutOfRange_Range
Definition SR.cs:1096
static string Argument_InvalidCalendar
Definition SR.cs:646
static string Argument_InvalidDateTimeStyles
Definition SR.cs:666
static string Argument_InvalidArrayLength
Definition SR.cs:642
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Arg_ArrayZeroError
Definition SR.cs:78
static string Format_BadFormatSpecifier
Definition SR.cs:1330
static string ArgumentNull_ArrayValue
Definition SR.cs:934
static string InvalidOperation_ReadOnly
Definition SR.cs:1504
static string ArgumentOutOfRange_InvalidEraValue
Definition SR.cs:1040
Definition SR.cs:7
object? GetFormat(Type? formatType)
DayOfWeek
Definition DayOfWeek.cs:4
TokenType
Definition TokenType.cs:4