/// <summary> /// Fetch options from the text editor and synchronize with future option changes. /// </summary> public void SynchronizeOptions(ITextEditorComponent textEditor) { if (textEditor == null) throw new ArgumentNullException("textEditor"); FetchOptions(textEditor.Options); TextEditorWeakEventManager.OptionChanged.AddListener(textEditor, this); }
public AvalonEditSyntaxHighlighterAdapter(ITextEditorComponent textEditor) { if (textEditor == null) { throw new ArgumentNullException("textEditor"); } this.textEditor = textEditor; }
public Highlighter(ITextEditorComponent textView) { textView.Document.TextChanged += (sender, args) => { _plusLinesSections.Clear(); _minusLinesSections.Clear(); _headers.Clear(); }; }
/// <summary> /// Fetch options from the text editor and synchronize with future option changes. /// </summary> public void SynchronizeOptions(ITextEditorComponent textEditor) { if (textEditor == null) { throw new ArgumentNullException("textEditor"); } FetchOptions(textEditor.Options); TextEditorWeakEventManager.OptionChanged.AddListener(textEditor, this); }
/// <inheritdoc/> protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e) { if (managerType == typeof(TextEditorWeakEventManager.OptionChanged)) { ITextEditorComponent component = (ITextEditorComponent)sender; FetchOptions(component.Options); return(true); } return(false); }
CodeEditorView GetTextEditorFromSender(object sender) { ITextEditorComponent textArea = (ITextEditorComponent)sender; CodeEditorView textEditor = (CodeEditorView)textArea.GetService(typeof(TextEditor)); if (textEditor == null) { throw new InvalidOperationException("could not find TextEditor service"); } return(textEditor); }
public AvalonEditSyntaxHighlighterAdapter(ITextEditorComponent textEditor) { if (textEditor == null) throw new ArgumentNullException("textEditor"); this.textEditor = textEditor; }
private static Collection<string> GetPositionFromFile(int line, ITextEditorComponent editor) { var collection = new Collection<string>(); while (true) { collection.Add(editor.Document.Lines[line].ToString()); line++; } return collection; }