public override WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions, HexViewCreatorOptions?options) { if (buffer is null) { throw new ArgumentNullException(nameof(buffer)); } if (roles is null) { throw new ArgumentNullException(nameof(roles)); } if (parentOptions is null) { throw new ArgumentNullException(nameof(parentOptions)); } var wpfHexView = new WpfHexViewImpl(buffer, roles, parentOptions, hexEditorOptionsFactoryService, commandService, formattedHexSourceFactoryService, hexViewClassifierAggregatorService, hexAndAdornmentSequencerFactoryService, hexBufferLineFormatterFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfHexViewCreationListeners, hexViewCreationListeners, classificationTypeRegistryService, hexCursorProviderFactories); if (!(options?.MenuGuid is null)) { var guidObjectsProvider = new GuidObjectsProvider(wpfHexView, options.CreateGuidObjects); menuService.InitializeContextMenu(wpfHexView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new HexContextMenuInitializer(wpfHexView)); } HexViewCreated?.Invoke(this, new HexViewCreatedEventArgs(wpfHexView)); foreach (var lz in hexEditorFactoryServiceListeners) { lz.Value.HexViewCreated(wpfHexView); } return(wpfHexView); }
public HexViewMouseProcessorCollection(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService, Lazy <HexMouseProcessorProvider, IOrderableTextViewRoleMetadata>[] mouseProcessorProviders) { this.wpfHexView = wpfHexView; wpfHexViewImpl = wpfHexView as WpfHexViewImpl; this.editorOperationsFactoryService = editorOperationsFactoryService; this.mouseProcessorProviders = mouseProcessorProviders; allowEventDelegate = AllowMouseEvent; wpfHexView.Closed += WpfHexView_Closed; Reinitialize(); }
public MouseHoverHelper(WpfHexViewImpl owner) { this.owner = owner; handlers = new List <MouseHoverHandler>(); timer = new DispatcherTimer(DispatcherPriority.Normal, owner.VisualElement.Dispatcher); timer.Tick += Timer_Tick; owner.VisualElement.MouseDown += WpfHexView_MouseDown; owner.VisualElement.MouseLeftButtonDown += WpfHexView_MouseLeftButtonDown; owner.VisualElement.MouseRightButtonDown += WpfHexView_MouseRightButtonDown; owner.VisualElement.MouseLeave += WpfHexView_MouseLeave; owner.VisualElement.MouseMove += WpfHexView_MouseMove; owner.VisualElement.IsVisibleChanged += WpfHexView_IsVisibleChanged; }