public WpfHexViewHostImpl(WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService, bool setFocus) { if (wpfHexViewMarginProviderCollectionProvider == null) throw new ArgumentNullException(nameof(wpfHexViewMarginProviderCollectionProvider)); if (wpfHexView == null) throw new ArgumentNullException(nameof(wpfHexView)); if (editorOperationsFactoryService == null) throw new ArgumentNullException(nameof(editorOperationsFactoryService)); contentControl = new ContentControl(); this.editorOperationsFactoryService = editorOperationsFactoryService; grid = CreateGrid(); HexView = wpfHexView; contentControl.Focusable = false; contentControl.Content = grid; contentControl.MouseWheel += ContentControl_MouseWheel; UpdateBackground(); HexView.BackgroundBrushChanged += HexView_BackgroundBrushChanged; containerMargins = new WpfHexViewMargin[5]; containerMargins[0] = CreateContainerMargin(wpfHexViewMarginProviderCollectionProvider, PredefinedHexMarginNames.Top, true, 0, 0, 3); containerMargins[1] = CreateContainerMargin(wpfHexViewMarginProviderCollectionProvider, PredefinedHexMarginNames.Bottom, true, 2, 0, 2); containerMargins[2] = CreateContainerMargin(wpfHexViewMarginProviderCollectionProvider, PredefinedHexMarginNames.BottomRightCorner, true, 2, 2, 1); containerMargins[3] = CreateContainerMargin(wpfHexViewMarginProviderCollectionProvider, PredefinedHexMarginNames.Left, false, 1, 0, 1); containerMargins[4] = CreateContainerMargin(wpfHexViewMarginProviderCollectionProvider, PredefinedHexMarginNames.Right, false, 1, 2, 1); Add(HexView.VisualElement, 1, 1, 1); Debug.Assert(!containerMargins.Any(a => a == null)); if (setFocus) { contentControl.Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { if (!HexView.IsClosed) HexView.VisualElement.Focus(); })); } }
public HexViewMouseProcessorCollection(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService, Lazy<HexMouseProcessorProvider, IOrderableTextViewRoleMetadata>[] mouseProcessorProviders) { this.wpfHexView = wpfHexView; wpfHexViewImpl = wpfHexView as WpfHexViewImpl; this.editorOperationsFactoryService = editorOperationsFactoryService; this.mouseProcessorProviders = mouseProcessorProviders; allowEventDelegate = AllowMouseEvent; wpfHexView.Closed += WpfHexView_Closed; Reinitialize(); }
HexViewSearchServiceProviderImpl(HexSearchServiceFactory hexSearchServiceFactory, SearchSettings searchSettings, IMessageBoxService messageBoxService, HexEditorOperationsFactoryService editorOperationsFactoryService) { this.hexSearchServiceFactory = hexSearchServiceFactory; this.searchSettings = searchSettings; this.messageBoxService = messageBoxService; this.editorOperationsFactoryService = editorOperationsFactoryService; }
MouseWpfHexViewCreationListener(HexEditorOperationsFactoryService editorOperationsFactoryService, [ImportMany] IEnumerable<Lazy<HexMouseProcessorProvider, IOrderableTextViewRoleMetadata>> mouseProcessorProviders) { this.editorOperationsFactoryService = editorOperationsFactoryService; this.mouseProcessorProviders = VSUTIL.Orderer.Order(mouseProcessorProviders).ToArray(); }
ZoomControlMarginProvider(HexEditorOperationsFactoryService editorOperationsFactoryService) { this.editorOperationsFactoryService = editorOperationsFactoryService; }
HexEditorFactoryServiceImpl(HexEditorOptionsFactoryService hexEditorOptionsFactoryService, ICommandService commandService, [ImportMany] IEnumerable<Lazy<WpfHexViewCreationListener, IDeferrableTextViewRoleMetadata>> wpfHexViewCreationListeners, [ImportMany] IEnumerable<Lazy<HexEditorFactoryServiceListener>> hexEditorFactoryServiceListeners, FormattedHexSourceFactoryService formattedHexSourceFactoryService, HexViewClassifierAggregatorService hexViewClassifierAggregatorService, HexAndAdornmentSequencerFactoryService hexAndAdornmentSequencerFactoryService, HexClassificationFormatMapService classificationFormatMapService, HexEditorFormatMapService editorFormatMapService, HexAdornmentLayerDefinitionService adornmentLayerDefinitionService, HexLineTransformProviderService lineTransformProviderService, WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, IMenuService menuService, HexEditorOperationsFactoryService editorOperationsFactoryService, HexSpaceReservationStackProvider spaceReservationStackProvider, HexBufferLineFormatterFactoryService hexBufferLineFormatterFactoryService, VSTC.IClassificationTypeRegistryService classificationTypeRegistryService, [ImportMany] IEnumerable<Lazy<HexCursorProviderFactory, ITextViewRoleMetadata>> hexCursorProviderFactories) { this.hexEditorOptionsFactoryService = hexEditorOptionsFactoryService; this.commandService = commandService; this.wpfHexViewCreationListeners = wpfHexViewCreationListeners.ToArray(); this.hexEditorFactoryServiceListeners = hexEditorFactoryServiceListeners.ToArray(); this.formattedHexSourceFactoryService = formattedHexSourceFactoryService; this.hexViewClassifierAggregatorService = hexViewClassifierAggregatorService; this.hexAndAdornmentSequencerFactoryService = hexAndAdornmentSequencerFactoryService; this.classificationFormatMapService = classificationFormatMapService; this.editorFormatMapService = editorFormatMapService; this.adornmentLayerDefinitionService = adornmentLayerDefinitionService; this.lineTransformProviderService = lineTransformProviderService; this.wpfHexViewMarginProviderCollectionProvider = wpfHexViewMarginProviderCollectionProvider; this.menuService = menuService; this.editorOperationsFactoryService = editorOperationsFactoryService; this.spaceReservationStackProvider = spaceReservationStackProvider; this.hexBufferLineFormatterFactoryService = hexBufferLineFormatterFactoryService; this.classificationTypeRegistryService = classificationTypeRegistryService; this.hexCursorProviderFactories = hexCursorProviderFactories.ToArray(); }
public DefaultHexViewMouseProcessor(WpfHexView wpfHexView, HexEditorOperationsFactoryService editorOperationsFactoryService) { if (wpfHexView == null) throw new ArgumentNullException(nameof(wpfHexView)); this.wpfHexView = wpfHexView; editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfHexView); }
LeftSelectionMarginProvider(WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, HexEditorOperationsFactoryService editorOperationsFactoryService) { this.wpfHexViewMarginProviderCollectionProvider = wpfHexViewMarginProviderCollectionProvider; 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); }