Ejemplo 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;
		}
Ejemplo n.º 2
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();
		}
Ejemplo n.º 3
0
		public DefaultHexViewMouseProcessor(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService) {
			if (wpfHexView == null)
				throw new ArgumentNullException(nameof(wpfHexView));
			this.wpfHexView = wpfHexView;
			editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView);
		}
		internal static void RemoveFromProperties(HexEditorOperations editorOperations) =>
			editorOperations.HexView.Properties.RemoveProperty(typeof(HexEditorOperations));
Ejemplo n.º 5
0
		public HexViewSearchServiceImpl(WpfHexView wpfHexView, HexSearchServiceFactory hexSearchServiceFactory, SearchSettings searchSettings, IMessageBoxService messageBoxService, HexEditorOperationsFactoryService editorOperationsFactoryService) {
			if (wpfHexView == null)
				throw new ArgumentNullException(nameof(wpfHexView));
			if (hexSearchServiceFactory == null)
				throw new ArgumentNullException(nameof(hexSearchServiceFactory));
			if (searchSettings == null)
				throw new ArgumentNullException(nameof(searchSettings));
			if (messageBoxService == null)
				throw new ArgumentNullException(nameof(messageBoxService));
			if (editorOperationsFactoryService == null)
				throw new ArgumentNullException(nameof(editorOperationsFactoryService));
			dataKinds = new ObservableCollection<DataKindVM>(dataKindVMList);
			selectedDataKindVM = dataKinds.First();
			this.wpfHexView = wpfHexView;
			editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView);
			this.hexSearchServiceFactory = hexSearchServiceFactory;
			this.searchSettings = searchSettings;
			this.messageBoxService = messageBoxService;
			listeners = new List<IHexMarkerListener>();
			searchString = string.Empty;
			replaceString = string.Empty;
			searchKind = SearchKind.None;
			searchControlPosition = SearchControlPosition.Default;
			wpfHexView.VisualElement.CommandBindings.Add(new CommandBinding(ApplicationCommands.Find, (s, e) => ShowFind()));
			wpfHexView.VisualElement.CommandBindings.Add(new CommandBinding(ApplicationCommands.Replace, (s, e) => ShowReplace()));
			wpfHexView.Closed += WpfHexView_Closed;
			UseGlobalSettings(true);
		}