示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 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;
 }