Пример #1
0
 public void SetLocalisedName(Locale locale, string name)
 {
     var localisedName = this.LocalisedNames.FirstOrDefault(localizedText => localizedText.Locale.Equals(locale));
     if (localisedName == null)
     {
         localisedName = new LocalisedTextBuilder(this.Strategy.Session).WithText(name).WithLocale(locale).Build();
         this.AddLocalisedName(localisedName);
     }
     else
     {
         localisedName.Text = name;
     }
 }
Пример #2
0
 public string GetLocalisedName(Locale locale)
 {
     var localisedName = this.LocalisedNames.FirstOrDefault(localizedText => localizedText.Locale.Equals(locale));
     return localisedName != null ? localisedName.Text : this.Name;
 }
Пример #3
0
 public static string ToString(this decimal dec, Locale locale)
 {
     var cultureInfo = locale != null ? locale.CultureInfo : null;
     return dec.ToString(cultureInfo);
 }