/// <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;
 }
Exemple #3
0
 public Highlighter(ITextEditorComponent textView)
 {
     textView.Document.TextChanged += (sender, args) =>
     {
         _plusLinesSections.Clear();
         _minusLinesSections.Clear();
         _headers.Clear();
     };
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
        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;
		}
Exemple #8
0
        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;
        }