private void LoadEditorSettings() { var storage = new LanguageSettingsStorage(this, Services, RGuidList.RLanguageServiceGuid, _editorOptionsPages.Keys); LanguageSettingsStorage = storage; storage.Load(); }
private void LoadEditorSettings() { var storage = new LanguageSettingsStorage(this, VsAppShell.Current.Services, MdGuidList.MdLanguageServiceGuid, _editorOptionsPages.Keys); LanguageSettingsStorage = storage; storage.Load(); }
private IEditorSettingsStorage GetStorage() { if (_storage == null) { var locator = _coreShell.GetService <IContentTypeServiceLocator>(); var provider = locator.GetService <IEditorSettingsStorageProvider>(_language); Debug.Assert(provider != null, "No editor storage found for language " + _language); _storage = provider.GetSettingsStorage(); } return(_storage); }
protected EditorSettings(IEditorSettingsStorage storage) { _storage = storage; }
public static bool GetValidationEnabled(IEditorSettingsStorage storage) { return(storage.GetBoolean(ValidationEnabledKey, true)); }
public static IndentType GetFormatterIndentType(IEditorSettingsStorage storage) { return (IndentType)storage.GetInteger(FormatterIndentTypeKey, (int)IndentType.Spaces); }
public static IndentType GetFormatterIndentType(IEditorSettingsStorage storage) { return((IndentType)storage.GetInteger(FormatterIndentTypeKey, (int)IndentType.Spaces)); }
public static IEditorSettingsStorage GetSettings(ICoreShell shell, string contentTypeName) { IEditorSettingsStorage settingsStorage = null; lock (_settingsLock) { if (_settingStorageMap.TryGetValue(contentTypeName, out settingsStorage)) { return(settingsStorage); } // Need to find the settings using MEF (don't use MEF inside of other locks, that can lead to deadlock) var contentTypeRegistry = shell.GlobalServices.GetService <IContentTypeRegistryService>(); var contentType = contentTypeRegistry.GetContentType(contentTypeName); Debug.Assert(contentType != null, "Cannot find content type object for " + contentTypeName); var cs = shell.CompositionService; settingsStorage = ComponentLocatorForOrderedContentType <IWritableEditorSettingsStorage> .FindFirstOrderedComponent(cs, contentType); if (settingsStorage == null) { settingsStorage = ComponentLocatorForOrderedContentType <IEditorSettingsStorage> .FindFirstOrderedComponent(cs, contentType); } if (settingsStorage == null) { var storages = ComponentLocatorForContentType <IWritableEditorSettingsStorage, IComponentContentTypes> .ImportMany(cs, contentType); if (storages.Count() > 0) { settingsStorage = storages.First().Value; } } if (settingsStorage == null) { var readonlyStorages = ComponentLocatorForContentType <IEditorSettingsStorage, IComponentContentTypes> .ImportMany(cs, contentType); if (readonlyStorages.Count() > 0) { settingsStorage = readonlyStorages.First().Value; } } Debug.Assert(settingsStorage != null, String.Format(CultureInfo.CurrentCulture, "Cannot find settings storage export for content type '{0}'", contentTypeName)); if (_settingStorageMap.ContainsKey(contentTypeName)) { // some other thread came along and loaded settings already settingsStorage = _settingStorageMap[contentTypeName]; } else { _settingStorageMap[contentTypeName] = settingsStorage; settingsStorage.LoadFromStorage(); } } return(settingsStorage); }
public static bool GetValidationEnabled(IEditorSettingsStorage storage) { return storage.GetBoolean(ValidationEnabledKey, true); }
public static bool GetAutoFormat(IEditorSettingsStorage storage) { return(storage.GetBoolean(AutoFormatKey, true)); }
public static bool GetSignatureHelpEnabled(IEditorSettingsStorage storage) { return storage.GetBoolean(SignatureHelpEnabledKey, true); }
public static IndentStyle GetIndentStyle(IEditorSettingsStorage storage) { return (IndentStyle)storage.GetInteger(IndentStyleKey, (int)IndentStyle.Smart); }
public static int GetFormatterTabSize(IEditorSettingsStorage storage) { return storage.GetInteger(FormatterTabSizeKey, 4); }
public REditorSettings() { _storage = new EditorSettingsStorage(); LintOptions = new LintOptions(() => _storage); }
public static int GetFormatterTabSize(IEditorSettingsStorage storage) { return(storage.GetInteger(FormatterTabSizeKey, 4)); }
protected EditorSettings(IEditorSettingsStorage storage) { Storage = storage; WritableStorage = storage as IWritableEditorSettingsStorage; }
public static IndentStyle GetIndentStyle(IEditorSettingsStorage storage) { return((IndentStyle)storage.GetInteger(IndentStyleKey, (int)IndentStyle.Smart)); }
public REditorSettings(IEditorSettingsStorage storage) : base(storage) { }
public static bool GetSignatureHelpEnabled(IEditorSettingsStorage storage) { return(storage.GetBoolean(SignatureHelpEnabledKey, true)); }
public REditorSettings(IEditorSettingsStorage storage) : base(storage) { CreateLintOptions(); }
public static bool GetAutoFormat(IEditorSettingsStorage storage) { return storage.GetBoolean(AutoFormatKey, true); }