public ContextActionsRenderer(CodeTextEditor editor, TextMarkerService textMarkerService) { if (editor == null) throw new ArgumentNullException(nameof(editor)); _editor = 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(); } else { editor.Loaded += OnEditorLoaded; } }
public TableTweakerWindow() { InitializeComponent(); _textMarkerService = new TextMarkerService(Editor); Editor.TextArea.TextView.BackgroundRenderers.Add(_textMarkerService); Editor.TextArea.TextView.LineTransformers.Add(_textMarkerService); Editor.Options = new TextEditorOptions { ConvertTabsToSpaces = true, AllowScrollBelowDocument = true, IndentationSize = 4 }; _syncContext = SynchronizationContext.Current; DataContextChanged += OnDataContextChanged; _paragraphStyle = Resources["ParagraphWithNoMarginStyle"] as Style; ManageUserSettings(); var helpContent = File.ReadAllText(@"Content\help.html"); Help.NavigateToString(helpContent); TbxInput.Focus(); _windowIsInitialized = true; Process(); }
public TextMarker(TextMarkerService service, int startOffset, int length) { if (service == null) throw new ArgumentNullException(nameof(service)); _service = service; StartOffset = startOffset; Length = length; }
public DocumentView() { InitializeComponent(); _textMarkerService = new TextMarkerService(Editor); Editor.TextArea.TextView.BackgroundRenderers.Add(_textMarkerService); Editor.TextArea.TextView.LineTransformers.Add(_textMarkerService); Editor.Options = new TextEditorOptions { ConvertTabsToSpaces = true, AllowScrollBelowDocument = true, IndentationSize = 4 }; _syncContext = SynchronizationContext.Current; DataContextChanged += OnDataContextChanged; }
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; editor.HookupLoadedUnloadedAction(HookupWindowMove); }
public TextMarkerToolTipProvider(TextMarkerService textMarkerService, TextEditor editor) { _textMarkerService = textMarkerService; _editor = editor; }
public TextMarker(TextMarkerService service, int startOffset, int length) { _service = service ?? throw new ArgumentNullException(nameof(service)); StartOffset = startOffset; Length = length; }