public TextViewListener(TextViewOptionsGroup owner, IWpfTextView textView) { this.owner = owner; this.textView = textView; textView.Closed += TextView_Closed; textView.Options.OptionChanged += Options_OptionChanged; textView.TextDataModel.ContentTypeChanged += TextDataModel_ContentTypeChanged; owner.InitializeOptions(textView, null, textView.TextDataModel.ContentType, force: true); }
TextViewOptionsGroup GetGroup(string name) { if (name is null) { throw new ArgumentNullException(nameof(name)); } if (!nameToGroup.TryGetValue(name, out var group)) { var defaultOptions = GetDefaultOptions(name); nameToGroup.Add(name, group = new TextViewOptionsGroup(name, contentTypeRegistryService, defaultOptions, optionsStorage)); } return(group); }
public TextViewGroupOption(TextViewOptionsGroup owner, ContentTypeOptionDefinition definition) { if (owner == null) { throw new ArgumentNullException(nameof(owner)); } if (definition == null) { throw new ArgumentNullException(nameof(definition)); } this.owner = owner; Definition = definition; theValue = Definition.DefaultValue; }