コード例 #1
0
			public MouseHoverHelper(WpfTextView owner) {
				this.owner = owner;
				handlers = new List<MouseHoverHandler>();
				timer = new DispatcherTimer(DispatcherPriority.Normal, owner.Dispatcher);
				timer.Tick += Timer_Tick;
				owner.MouseDown += WpfTextView_MouseDown;
				owner.MouseLeftButtonDown += WpfTextView_MouseLeftButtonDown;
				owner.MouseRightButtonDown += WpfTextView_MouseRightButtonDown;
				owner.MouseLeave += WpfTextView_MouseLeave;
				owner.MouseMove += WpfTextView_MouseMove;
				owner.IsVisibleChanged += WpfTextView_IsVisibleChanged;
			}
コード例 #2
0
 public MouseHoverHelper(WpfTextView owner)
 {
     this.owner                  = owner;
     this.handlers               = new List <MouseHoverHandler>();
     this.timer                  = new DispatcherTimer(DispatcherPriority.Normal, owner.Dispatcher);
     timer.Tick                 += Timer_Tick;
     owner.MouseDown            += WpfTextView_MouseDown;
     owner.MouseLeftButtonDown  += WpfTextView_MouseLeftButtonDown;
     owner.MouseRightButtonDown += WpfTextView_MouseRightButtonDown;
     owner.MouseLeave           += WpfTextView_MouseLeave;
     owner.MouseMove            += WpfTextView_MouseMove;
     owner.IsVisibleChanged     += WpfTextView_IsVisibleChanged;
 }
コード例 #3
0
        IDnSpyWpfTextView CreateTextViewImpl(ITextViewModel textViewModel, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions options, Func <IGuidObjectsProvider> createGuidObjectsProvider = null)
        {
            var guidObjectsProvider = new GuidObjectsProvider(options?.CreateGuidObjects, createGuidObjectsProvider?.Invoke());
            var wpfTextView         = new WpfTextView(textViewModel, roles, parentOptions, editorOptionsFactoryService, commandManager, smartIndentationService, formattedTextSourceFactoryService, viewClassifierAggregatorService, textAndAdornmentSequencerFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfTextViewConnectionListenerServiceProvider, bufferGraphFactoryService, wpfTextViewCreationListeners);

            guidObjectsProvider.WpfTextView = wpfTextView;

            if (options?.MenuGuid != null)
            {
                menuManager.InitializeContextMenu(wpfTextView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new ContextMenuInitializer(wpfTextView));
            }

            TextViewCreated?.Invoke(this, new TextViewCreatedEventArgs(wpfTextView));

            return(wpfTextView);
        }
コード例 #4
0
        IDsWpfTextView CreateTextViewImpl(ITextViewModel textViewModel, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions?options)
        {
            var wpfTextView = new WpfTextView(textViewModel, roles, parentOptions, editorOptionsFactoryService, commandService, smartIndentationService, formattedTextSourceFactoryService, viewClassifierAggregatorService, textAndAdornmentSequencerFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfTextViewConnectionListenerServiceProvider, bufferGraphFactoryService, wpfTextViewCreationListeners, textViewCreationListeners);

            if (!(options?.MenuGuid is null))
            {
                var guidObjectsProvider = new GuidObjectsProvider(wpfTextView, options.CreateGuidObjects);
                menuService.InitializeContextMenu(wpfTextView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new ContextMenuInitializer(wpfTextView));
            }

            if (options?.EnableUndoHistory != false)
            {
                textViewUndoManagerProvider.Value.GetTextViewUndoManager(wpfTextView);
            }

            TextViewCreated?.Invoke(this, new TextViewCreatedEventArgs(wpfTextView));

            return(wpfTextView);
        }
コード例 #5
0
		IDsWpfTextView CreateTextViewImpl(ITextViewModel textViewModel, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions options) {
			var wpfTextView = new WpfTextView(textViewModel, roles, parentOptions, editorOptionsFactoryService, commandService, smartIndentationService, formattedTextSourceFactoryService, viewClassifierAggregatorService, textAndAdornmentSequencerFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfTextViewConnectionListenerServiceProvider, bufferGraphFactoryService, wpfTextViewCreationListeners);

			if (options?.MenuGuid != null) {
				var guidObjectsProvider = new GuidObjectsProvider(wpfTextView, options?.CreateGuidObjects);
				menuService.InitializeContextMenu(wpfTextView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new ContextMenuInitializer(wpfTextView));
			}

			if (options?.EnableUndoHistory != false)
				textViewUndoManagerProvider.Value.GetTextViewUndoManager(wpfTextView);

			TextViewCreated?.Invoke(this, new TextViewCreatedEventArgs(wpfTextView));

			return wpfTextView;
		}