private static void AddCulture(CultureInfo culture) { lock (locker) { if (culture == null || Parsings.ContainsKey(culture)) { return; } Parsings[culture] = new Dictionary <string, byte>(); for (byte m = 1; m <= 12; m++) { var full = Parsing.ToUnified(culture.DateTimeFormat.GetAbbreviatedMonthName(m)); var shrt = Parsing.ToUnified(culture.DateTimeFormat.GetMonthName(m)); if (!Parsings[CultureInfo.InvariantCulture].ContainsKey(full)) { Parsings[culture][full] = m; } if (!Parsings[CultureInfo.InvariantCulture].ContainsKey(shrt)) { Parsings[culture][shrt] = m; } } } }
/// <summary>Adds a culture to the parsings.</summary> /// <param name="culture"> /// The culture to add. /// </param> private static void AddCulture(CultureInfo culture) { lock (locker) { if (Parsings.ContainsKey(culture)) { return; } Parsings[culture] = new Dictionary <string, string>(); Parsings[culture][Unknown.GetDisplayName(culture)] = Unknown.m_Value; foreach (var country in Currency.AllCurrencies) { Parsings[culture][Parsing.ToUnified(country.GetDisplayName(culture))] = country.m_Value; } } }
/// <summary>Adds a culture to the parsings.</summary> /// <param name="culture"> /// The culture to add. /// </param> private static void AddCulture(CultureInfo culture) { lock (locker) { if (Parsings.ContainsKey(culture)) { return; } Parsings[culture] = new Dictionary <string, byte>(); foreach (var gender in All) { var longname = gender.ToString("", culture).ToUpper(culture); var shortname = gender.ToString("c", culture).ToUpper(culture); Parsings[culture][longname] = gender.m_Value; Parsings[culture][shortname] = gender.m_Value; } } }
/// <summary>Adds a culture to the parsings.</summary> /// <param name="culture"> /// The culture to add. /// </param> private static void AddCulture(CultureInfo culture) { lock (Locker) { if (Parsings.ContainsKey(culture)) { return; } Parsings[culture] = new Dictionary <string, byte>(); foreach (var value in YesAndNo) { var label = value.ToString("", culture).ToUpper(culture); var @char = value.ToString("c", culture).ToUpper(culture); var @bool = value.ToString("b", culture).ToUpper(culture); Parsings[culture][label] = value.m_Value; Parsings[culture][@char] = value.m_Value; Parsings[culture][@bool] = value.m_Value; } } }
public SparkViewFacility(SparkTemplateRegistry templateRegistry, Parsings parsings) { _templateRegistry = templateRegistry; _parsings = parsings; }