コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: TextMarker.cs プロジェクト: mjheitland/TableTweaker
 public TextMarker(TextMarkerService service, int startOffset, int length)
 {
     if (service == null)
         throw new ArgumentNullException(nameof(service));
     _service = service;
     StartOffset = startOffset;
     Length = length;
 }
コード例 #4
0
        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;
        }
コード例 #5
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;

            editor.HookupLoadedUnloadedAction(HookupWindowMove);
        }
コード例 #6
0
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, TextEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor            = editor;
 }
コード例 #7
0
 public TextMarker(TextMarkerService service, int startOffset, int length)
 {
     _service    = service ?? throw new ArgumentNullException(nameof(service));
     StartOffset = startOffset;
     Length      = length;
 }
コード例 #8
0
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, TextEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor = editor;
 }