public DefaultHexViewCommandTarget(HexView hexView, HexEditorOperationsFactoryService editorOperationsFactoryService) { if (hexView == null) { throw new ArgumentNullException(nameof(hexView)); } this.hexView = hexView; EditorOperations = editorOperationsFactoryService.GetEditorOperations(hexView); }
public DefaultHexViewMouseProcessor(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService) { if (wpfHexView == null) { throw new ArgumentNullException(nameof(wpfHexView)); } this.wpfHexView = wpfHexView; editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView); }
void ContentControl_MouseWheel(object?sender, MouseWheelEventArgs e) { if (!IsClosed && !e.Handled) { e.Handled = true; if (e.Delta == 0) { return; } if ((Keyboard.Modifiers & ModifierKeys.Control) != 0 && CanMouseWheelZoom) { var editorOperations = editorOperationsFactoryService.GetEditorOperations(HexView); if (e.Delta > 0) { editorOperations.ZoomIn(); } else { editorOperations.ZoomOut(); } } else { int lines = GetScrollWheelLines(); var direction = e.Delta < 0 ? VSTE.ScrollDirection.Down : VSTE.ScrollDirection.Up; if (lines >= 0) { HexView.ViewScroller.ScrollViewportVerticallyByLines(direction, lines); } else { HexView.ViewScroller.ScrollViewportVerticallyByPage(direction); } } } }
public override WpfHexViewMargin CreateMargin(WpfHexViewHost wpfHexViewHost, WpfHexViewMargin marginContainer) => new LeftSelectionMargin(wpfHexViewMarginProviderCollectionProvider, wpfHexViewHost, editorOperationsFactoryService.GetEditorOperations(wpfHexViewHost.HexView));
public override WpfHexViewMargin CreateMargin(WpfHexViewHost wpfHexViewHost, WpfHexViewMargin marginContainer) => new ZoomControlMargin(wpfHexViewHost, editorOperationsFactoryService.GetEditorOperations(wpfHexViewHost.HexView));