HexViewSearchServiceProviderImpl(HexSearchServiceFactory hexSearchServiceFactory, SearchSettings searchSettings, IMessageBoxService messageBoxService, HexEditorOperationsFactoryService editorOperationsFactoryService) { this.hexSearchServiceFactory = hexSearchServiceFactory; this.searchSettings = searchSettings; this.messageBoxService = messageBoxService; this.editorOperationsFactoryService = editorOperationsFactoryService; }
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); }