Exemplo n.º 1
0
		public LeftSelectionMargin(WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, WpfHexViewHost wpfHexViewHost, HexEditorOperations editorOperations)
			: base(wpfHexViewMarginProviderCollectionProvider, wpfHexViewHost, PredefinedHexMarginNames.LeftSelection, false) {
			if (editorOperations == null)
				throw new ArgumentNullException(nameof(editorOperations));
			VisualElement.Cursor = Cursors.Arrow;//TODO: Use an arrow pointing to the right
			this.wpfHexViewHost = wpfHexViewHost;
			this.editorOperations = 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 DefaultHexViewCommandTarget(HexView hexView, HexEditorOperationsFactoryService editorOperationsFactoryService) {
			if (hexView == null)
				throw new ArgumentNullException(nameof(hexView));
			this.hexView = hexView;
			EditorOperations = editorOperationsFactoryService.GetEditorOperations(hexView);
		}
Exemplo n.º 3
0
		public ZoomControlMargin(WpfHexViewHost wpfHexViewHost, HexEditorOperations editorOperations) {
			if (wpfHexViewHost == null)
				throw new ArgumentNullException(nameof(wpfHexViewHost));
			if (editorOperations == null)
				throw new ArgumentNullException(nameof(editorOperations));
			zoomControl = new TheZoomControl(this);
			this.wpfHexViewHost = wpfHexViewHost;
			this.editorOperations = 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();
		}