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); }
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; }
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(); }
internal static void RemoveFromProperties(HexEditorOperations editorOperations) => editorOperations.HexView.Properties.RemoveProperty(typeof(HexEditorOperations));