Exemple #1
0
        public ContextActionsRenderer(CodeTextEditor editor, TextMarkerService textMarkerService)
        {
            _editor            = editor ?? throw new ArgumentNullException(nameof(editor));
            _textMarkerService = textMarkerService;

            editor.TextArea.Caret.PositionChanged += CaretPositionChanged;

            editor.KeyDown += ContextActionsRenderer_KeyDown;
            _providers      = new ObservableCollection <IContextActionProvider>();
            _providers.CollectionChanged += providers_CollectionChanged;

            editor.TextArea.TextView.ScrollOffsetChanged += ScrollChanged;
            _delayMoveTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(DelayMoveMilliseconds)
            };
            _delayMoveTimer.Stop();
            _delayMoveTimer.Tick += TimerMoveTick;

            if (editor.IsLoaded)
            {
                HookupWindowMove(enable: true);
            }

            editor.Loaded   += OnEditorLoaded;
            editor.Unloaded += OnEditorUnloaded;
        }
Exemple #2
0
 public TextMarkerService(CodeTextEditor editor)
 {
     if (editor == null)
     {
         throw new ArgumentNullException(nameof(editor));
     }
     _document              = editor.Document;
     _markers               = new TextSegmentCollection <TextMarker>(_document);
     _textViews             = new List <TextView>();
     editor.ToolTipRequest += EditorOnToolTipRequest;
 }
Exemple #3
0
 public void OpenAtLineStart(CodeTextEditor editor)
 {
     SetPosition(this, editor, editor.TextArea.Caret.Line, 1);
     VerticalOffset -= 16;
     IsOpenIfFocused = true;
 }