private bool NlsLoadCalendarDataFromSystem(string localeName, CalendarId calendarId)
{
bool ret = true;
uint useOverrides = bUseUserOverrides ? 0 : CAL_NOUSEROVERRIDE;
NormalizeCalendarId(ref calendarId, ref localeName);
// Numbers
ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_ITWODIGITYEARMAX | useOverrides, out this.iTwoDigitYearMax);
// Strings
ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_SCALNAME, out this.sNativeName);
ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_SMONTHDAY, out this.sMonthDay);
// String Arrays
// Formats
ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SSHORTDATE, LOCALE_SSHORTDATE | useOverrides, out this.saShortDates !);
ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SLONGDATE, LOCALE_SLONGDATE | useOverrides, out this.saLongDates !);
// Get the YearMonth pattern.
ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SYEARMONTH, LOCALE_SYEARMONTH, out this.saYearMonths !);
// Day & Month Names
// These are all single calType entries, 1 per day, so we have to make 7 or 13 calls to collect all the names
// Day
// Note that we're off-by-one since managed starts on sunday and windows starts on monday
ret &= GetCalendarDayInfo(localeName, calendarId, CAL_SDAYNAME7, out this.saDayNames);
ret &= GetCalendarDayInfo(localeName, calendarId, CAL_SABBREVDAYNAME7, out this.saAbbrevDayNames);
// Month names
ret &= GetCalendarMonthInfo(localeName, calendarId, CAL_SMONTHNAME1, out this.saMonthNames);
ret &= GetCalendarMonthInfo(localeName, calendarId, CAL_SABBREVMONTHNAME1, out this.saAbbrevMonthNames);
//
// The following LCTYPE are not supported in some platforms. If the call fails,
// don't return a failure.
//
GetCalendarDayInfo(localeName, calendarId, CAL_SSHORTESTDAYNAME7, out this.saSuperShortDayNames);
// Gregorian may have genitive month names
if (calendarId == CalendarId.GREGORIAN)
{
GetCalendarMonthInfo(localeName, calendarId, CAL_SMONTHNAME1 | CAL_RETURN_GENITIVE_NAMES, out this.saMonthGenitiveNames);
GetCalendarMonthInfo(localeName, calendarId, CAL_SABBREVMONTHNAME1 | CAL_RETURN_GENITIVE_NAMES, out this.saAbbrevMonthGenitiveNames);
}
// Calendar Parts Names
// This doesn't get always get localized names for gregorian (not available in windows < 7)
// so: eg: coreclr on win < 7 won't get these
CallEnumCalendarInfo(localeName, calendarId, CAL_SERASTRING, 0, out this.saEraNames !);
CallEnumCalendarInfo(localeName, calendarId, CAL_SABBREVERASTRING, 0, out this.saAbbrevEraNames !);
//
// Calendar Era Info
// Note that calendar era data (offsets, etc) is hard coded for each calendar since this
// data is implementation specific and not dynamic (except perhaps Japanese)
//
// Clean up the escaping of the formats
this.saShortDates = CultureData.ReescapeWin32Strings(this.saShortDates) !;
this.saLongDates = CultureData.ReescapeWin32Strings(this.saLongDates) !;
this.saYearMonths = CultureData.ReescapeWin32Strings(this.saYearMonths) !;
this.sMonthDay = CultureData.ReescapeWin32String(this.sMonthDay) !;
return(ret);
}