Example #1
0
 public DocumentViewer(IWpfCommandService wpfCommandService, IDocumentViewerServiceImpl documentViewerServiceImpl, IMenuService menuService, DocumentViewerControl documentViewerControl)
 {
     if (wpfCommandService == null)
     {
         throw new ArgumentNullException(nameof(wpfCommandService));
     }
     if (documentViewerServiceImpl == null)
     {
         throw new ArgumentNullException(nameof(documentViewerServiceImpl));
     }
     if (menuService == null)
     {
         throw new ArgumentNullException(nameof(menuService));
     }
     if (documentViewerControl == null)
     {
         throw new ArgumentNullException(nameof(documentViewerControl));
     }
     this.wpfCommandService         = wpfCommandService;
     this.documentViewerServiceImpl = documentViewerServiceImpl;
     this.documentViewerControl     = documentViewerControl;
     menuService.InitializeContextMenu(documentViewerControl.TextView.VisualElement, MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID, new GuidObjectsProvider(this), new ContextMenuInitializer(documentViewerControl.TextView));
     // Prevent the tab control's context menu from popping up when right-clicking in the textview host margin
     menuService.InitializeContextMenu(documentViewerControl, Guid.NewGuid());
     wpfCommandService.Add(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT, documentViewerControl);
     documentViewerControl.TextView.Properties.AddProperty(typeof(DocumentViewer), this);
     documentViewerControl.TextView.TextBuffer.Properties.AddProperty(DocumentViewerExtensions.DocumentViewerTextBufferKey, this);
 }
		DocumentViewerProvider(IWpfCommandService wpfCommandService, IMenuService menuService, IDocumentViewerServiceImpl documentViewerServiceImpl, ITextBufferFactoryService textBufferFactoryService, IDsTextEditorFactoryService dsTextEditorFactoryService) {
			this.wpfCommandService = wpfCommandService;
			this.menuService = menuService;
			this.documentViewerServiceImpl = documentViewerServiceImpl;
			this.textBufferFactoryService = textBufferFactoryService;
			this.dsTextEditorFactoryService = dsTextEditorFactoryService;
		}
Example #3
0
 DocumentViewerProvider(IWpfCommandManager wpfCommandManager, IMenuManager menuManager, IDocumentViewerServiceImpl documentViewerServiceImpl, ITextBufferFactoryService textBufferFactoryService, IDnSpyTextEditorFactoryService dnSpyTextEditorFactoryService)
 {
     this.wpfCommandManager             = wpfCommandManager;
     this.menuManager                   = menuManager;
     this.documentViewerServiceImpl     = documentViewerServiceImpl;
     this.textBufferFactoryService      = textBufferFactoryService;
     this.dnSpyTextEditorFactoryService = dnSpyTextEditorFactoryService;
 }
Example #4
0
		public DocumentViewer(IWpfCommandService wpfCommandService, IDocumentViewerServiceImpl documentViewerServiceImpl, IMenuService menuService, DocumentViewerControl documentViewerControl) {
			if (wpfCommandService == null)
				throw new ArgumentNullException(nameof(wpfCommandService));
			if (documentViewerServiceImpl == null)
				throw new ArgumentNullException(nameof(documentViewerServiceImpl));
			if (menuService == null)
				throw new ArgumentNullException(nameof(menuService));
			if (documentViewerControl == null)
				throw new ArgumentNullException(nameof(documentViewerControl));
			this.wpfCommandService = wpfCommandService;
			this.documentViewerServiceImpl = documentViewerServiceImpl;
			this.documentViewerControl = documentViewerControl;
			menuService.InitializeContextMenu(documentViewerControl.TextView.VisualElement, MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID, new GuidObjectsProvider(this), new ContextMenuInitializer(documentViewerControl.TextView));
			// Prevent the tab control's context menu from popping up when right-clicking in the textview host margin
			menuService.InitializeContextMenu(documentViewerControl, Guid.NewGuid());
			wpfCommandService.Add(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT, documentViewerControl);
			documentViewerControl.TextView.Properties.AddProperty(typeof(DocumentViewer), this);
			documentViewerControl.TextView.TextBuffer.Properties.AddProperty(DocumentViewerExtensions.DocumentViewerTextBufferKey, this);
		}