public static LanguageFileDictionary Deserialize(string json)
        {
            LanguageFileDictionary languageFileDictionary = new LanguageFileDictionary();
            JObject jObject = JObject.Parse(json);

            languageFileDictionary.CultureString        = jObject.Value <string>("CultureString");
            languageFileDictionary.LanguageFileContents = new Dictionary <string, LanguageFileContent>();
            foreach (JToken jToken in jObject.GetValue("LanguageFileContents"))
            {
                JProperty jProperty = (JProperty)jToken;
                languageFileDictionary.LanguageFileContents.Add(jProperty.Name,
                                                                new LanguageFileText(((JObject)jProperty.Value).Value <string>("Content")));
            }

            return(languageFileDictionary);
        }
        public static string Serialize(LanguageFileDictionary languageFileDictionary)
        {
            JObject jObject = JObject.FromObject(languageFileDictionary);

            return(jObject.ToString(Formatting.Indented));
        }
Beispiel #3
0
 public void SelectLanguage(CultureInfo cultureInfo)
 {
     SelectedLanguage = _languageFiles[cultureInfo.Name];
 }
Beispiel #4
0
 public void SelectDefaultLanguage()
 {
     SelectedLanguage = _languageFiles[CultureInfo.CurrentCulture.Name];
 }
Beispiel #5
0
 public void SelectLanguage(string cultureString)
 {
     SelectedLanguage = _languageFiles[cultureString];
 }