コード例 #1
0
            public IncludeWhitespacesProperty(EditorPreferences editorPreferences)
            {
                this.editorPreferences = editorPreferences;
                var definition = editorPreferences.factoryService.GetOptionDefinition(DefaultTextViewOptions.UseVisibleWhitespaceIncludeName);

                propertyValue = PropertyService.Get(propertyName, Convert((DefaultTextViewOptions.IncludeWhitespaces)definition.DefaultValue));
                UpdateEditor(propertyValue);
                editorPreferences.globalOptions.OptionChanged += GlobalOptions_OptionChanged;
            }
コード例 #2
0
            public ShowWhitespacesProperty(EditorPreferences editorPreferences)
            {
                this.editorPreferences = editorPreferences;
                var definitionEnabled   = editorPreferences.factoryService.GetOptionDefinition(DefaultTextViewOptions.UseVisibleWhitespaceName);
                var definitionSelection = editorPreferences.factoryService.GetOptionDefinition(DefaultTextViewOptions.UseVisibleWhitespaceOnlyWhenSelectedName);

                value = PropertyService.Get(propertyName, Convert((bool)definitionEnabled.DefaultValue, (bool)definitionSelection.DefaultValue));
                UpdateEditor(value);
                editorPreferences.globalOptions.OptionChanged += GlobalOptions_OptionChanged;
            }
コード例 #3
0
        static async Task <(EditorPreferences, IEditorOptions, ConfigurationProperty <bool>)> GetEditorPreferences(bool unset = true)
        {
            if (unset)
            {
                PropertyService.Set(mdPropertyKey, null);
            }

            var preferences = new EditorPreferences();

            var factoryService = CompositionManager.Instance.GetExportedValue <IEditorOptionsFactoryService2> ();
            var preference     = preferences.Wrap(mdPropertyKey, editorOptionKey, false);

            return(preferences, factoryService.GlobalOptions, preference);
        }