public static void RemoveLanguage(string name) { string path = Path.Combine(LESettings.VisualLocFilePath, name + LEConstants.VisualFileExtension); string logicalPath = Path.Combine(LESettings.LogicalLocFilePath, name + LEConstants.LogicalFileExtension); // Delete the language file File.Delete(path); File.Delete(logicalPath); // Remove the language from the collection AllLangsVisual.Remove(name); AllLangsLogical.Remove(name); // If the deleted language is currently selected, unset it if (CurrentLanguage.Equals(name)) { CurrentLanguage = string.Empty; } if (AllLangsLogical.Count == 0) { MasterKeys.Clear(); } NeedsSave = true; }
public static void ClearAll() { AllLangsLogical.Clear(); AllLangsVisual.Clear(); VisualStringCache.Clear(); NeedsSave = true; }
public static void AddNewLanguage(string name) { LELangDict newLang = new LELangDict(); LELangDict newVisLang = new LELangDict(); MasterKeys.ForEach(masterKey => { newLang.Add(masterKey, string.Empty); newVisLang.Add(Logical2Visual(masterKey), string.Empty); }); AllLangsLogical.Add(name, newLang); AllLangsVisual.Add(name, newVisLang); NeedsSave = true; }
public static void UpdateString(string lang, string key, string value) { string visKey = GetPresentationFromCache(key); string visValue = Logical2Visual(value); Dbg.Assert(AllLangsVisual.ContainsKey(lang)); Dbg.Assert(AllLangsVisual[lang].ContainsKey(visKey)); Dbg.Assert(AllLangsLogical.ContainsKey(lang)); Dbg.Assert(AllLangsLogical[lang].ContainsKey(key)); AllLangsVisual[lang][visKey] = visValue; AllLangsLogical[lang][key] = value; NeedsSave = true; }