public DefaultHexViewCommandTarget(HexView hexView, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     if (hexView == null)
     {
         throw new ArgumentNullException(nameof(hexView));
     }
     this.hexView     = hexView;
     EditorOperations = editorOperationsFactoryService.GetEditorOperations(hexView);
 }
示例#2
0
 public DefaultHexViewMouseProcessor(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     if (wpfHexView == null)
     {
         throw new ArgumentNullException(nameof(wpfHexView));
     }
     this.wpfHexView  = wpfHexView;
     editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView);
 }
示例#3
0
        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);
                    }
                }
            }
        }
示例#4
0
 public override WpfHexViewMargin CreateMargin(WpfHexViewHost wpfHexViewHost, WpfHexViewMargin marginContainer) =>
 new LeftSelectionMargin(wpfHexViewMarginProviderCollectionProvider, wpfHexViewHost, editorOperationsFactoryService.GetEditorOperations(wpfHexViewHost.HexView));
示例#5
0
 public override WpfHexViewMargin CreateMargin(WpfHexViewHost wpfHexViewHost, WpfHexViewMargin marginContainer) =>
 new ZoomControlMargin(wpfHexViewHost, editorOperationsFactoryService.GetEditorOperations(wpfHexViewHost.HexView));