示例#1
0
 /// <summary>
 /// Loads the settings from the settings store
 /// </summary>
 public static void LoadSettings()
 {
     ThreadHelper.ThrowIfNotOnUIThread();
     if (!loadedFromStorage)
     {
         WritableSettingsStore settingsStore = GetWritableSettingsStore();
         indentSize.Set(settingsStore.LoadIndentSize());
         colors.Set(settingsStore.LoadColors());
         opacityMultiplier.Set(settingsStore.LoadOpacityMultiplier());
         highlightingMode.Set(settingsStore.LoadHighlightingMode());
         errorColor.Set(settingsStore.LoadErrorColor());
         detectErrors.Set(settingsStore.LoadDetectErrorsFlag());
         fileExtensionsString.Set(settingsStore.LoadFileExtensionsIndentSizes());
         //This fields have to be initialized after the other fields since they depend on them
         loadedFromStorage = true;
         brushes.Set(ColorParser.ConvertStringToBrushArray(colors.Get(), opacityMultiplier.Get()));
         errorBrush.Set(ColorParser.ConvertStringToBrush(errorColor.Get(), opacityMultiplier.Get()));
         fileExtensionsDictionary.Set(LanguageParser.CreateDictionaryFromString(fileExtensionsString.Get()));
     }
 }