Esempio n. 1
0
 public DefaultHexViewMouseProcessor(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     if (wpfHexView == null)
     {
         throw new ArgumentNullException(nameof(wpfHexView));
     }
     this.wpfHexView  = wpfHexView;
     editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView);
 }
 public DefaultHexViewCommandTarget(HexView hexView, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     if (hexView == null)
     {
         throw new ArgumentNullException(nameof(hexView));
     }
     this.hexView     = hexView;
     EditorOperations = editorOperationsFactoryService.GetEditorOperations(hexView);
 }
Esempio n. 3
0
 public LeftSelectionMargin(WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, WpfHexViewHost wpfHexViewHost, HexEditorOperations editorOperations)
     : base(wpfHexViewMarginProviderCollectionProvider, wpfHexViewHost, PredefinedHexMarginNames.LeftSelection, false)
 {
     VisualElement.Cursor  = Cursors.Arrow;           //TODO: Use an arrow pointing to the right
     this.wpfHexViewHost   = wpfHexViewHost;
     this.editorOperations = editorOperations ?? throw new ArgumentNullException(nameof(editorOperations));
     wpfHexViewHost.HexView.ZoomLevelChanged += HexView_ZoomLevelChanged;
     // Make sure that the user can click anywhere in this margin so we'll get mouse events
     Grid.Background = Brushes.Transparent;
     VisualElement.MouseLeftButtonDown += VisualElement_MouseLeftButtonDown;
     VisualElement.MouseLeftButtonUp   += VisualElement_MouseLeftButtonUp;
     VisualElement.MouseMove           += VisualElement_MouseMove;
 }
Esempio n. 4
0
        public ZoomControlMargin(WpfHexViewHost wpfHexViewHost, HexEditorOperations editorOperations)
        {
            zoomControl           = new TheZoomControl(this);
            this.wpfHexViewHost   = wpfHexViewHost ?? throw new ArgumentNullException(nameof(wpfHexViewHost));
            this.editorOperations = editorOperations ?? throw new ArgumentNullException(nameof(editorOperations));

            wpfHexViewHost.HexView.Options.OptionChanged += Options_OptionChanged;

            // Need to set these explicitly so our themed styles are used
            zoomControl.SetResourceReference(FrameworkElement.StyleProperty, typeof(ComboBox));
            zoomControl.SetResourceReference(ItemsControl.ItemContainerStyleProperty, typeof(ComboBoxItem));
            zoomControl.MinHeight = 0;
            zoomControl.Margin    = new Thickness(0);
            zoomControl.Width     = 60;
            UpdateVisibility();
        }
Esempio n. 5
0
 internal static void RemoveFromProperties(HexEditorOperations editorOperations) =>
 editorOperations.HexView.Properties.RemoveProperty(typeof(HexEditorOperations));