/// <summary> /// Initializes static members of the <see cref="PreprocessingConfigurationManager"/> class. /// </summary> static PreprocessingConfigurationManager() { StoredConfigs = new Dictionary <string, string>(); var loadedConfigs = UserSettingsUtility.LoadPreprocessingConfigs(); foreach (var entry in loadedConfigs) { StoredConfigs.Add(entry.Key, entry.Value); } }
/// <summary> /// Add config and save settings /// </summary> /// <param name="templateId">Template id</param> /// <param name="config">Serialized config</param> public static void AddConfig(string templateId, string config) { if (CheckConfigExists(templateId)) { StoredConfigs[templateId] = config; } else { StoredConfigs.Add(templateId, config); } UserSettingsUtility.SavePreprocessingConfigs(StoredConfigs); }
/// <summary> /// Initializes static members of the <see cref="AnswersMappingHelper"/> class. /// </summary> static AnswersMappingHelper() { AnswersMappingDictionary = new Dictionary <string, string[]>(); CustomMappingDictionary = new Dictionary <string, string[]>(); // add default values AnswersMappingDictionary.Add(englishLettersKeyUpper, EnglishLettersUppercase); AnswersMappingDictionary.Add(englishLettersKeyLower, EnglishLettersLowercase); AnswersMappingDictionary.Add(digitsFromOneKey, DigitsFromOne); AnswersMappingDictionary.Add(digitsFromZeroKey, DigitsFromZero); // load from settings and add user entries in format : "name" (or key) - "values" CustomMappingDictionary = UserSettingsUtility.LoadCustomMappings(); foreach (var entry in CustomMappingDictionary) { AnswersMappingDictionary.Add(entry.Key, entry.Value); } }
/// <summary> /// Update saved settings with new recent files list /// </summary> /// <param name="recentFiles">Recent files list</param> public static void UpdateRecentFiles(List <string> recentFiles) { UserSettingsUtility.SaveRecentFiles(recentFiles.ToArray()); }
/// <summary> /// Add custom mapping and save settings /// </summary> /// <param name="key">Shortcut string</param> /// <param name="mappingValues">Mapping values</param> public static void AddCustomMapping(string key, string[] mappingValues) { AnswersMappingDictionary.Add(key, mappingValues); CustomMappingDictionary.Add(key, mappingValues); UserSettingsUtility.SaveCustomMappings(CustomMappingDictionary); }