HexViewSearchServiceProviderImpl(HexSearchServiceFactory hexSearchServiceFactory, SearchSettings searchSettings, IMessageBoxService messageBoxService, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     this.hexSearchServiceFactory        = hexSearchServiceFactory;
     this.searchSettings                 = searchSettings;
     this.messageBoxService              = messageBoxService;
     this.editorOperationsFactoryService = editorOperationsFactoryService;
 }
示例#2
0
 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 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();
 }
示例#5
0
        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();
                    }
                }));
            }
        }
示例#6
0
 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();
 }
示例#7
0
 ZoomControlMarginProvider(HexEditorOperationsFactoryService editorOperationsFactoryService) => this.editorOperationsFactoryService = editorOperationsFactoryService;
示例#8
0
 LeftSelectionMarginProvider(WpfHexViewMarginProviderCollectionProvider wpfHexViewMarginProviderCollectionProvider, HexEditorOperationsFactoryService editorOperationsFactoryService)
 {
     this.wpfHexViewMarginProviderCollectionProvider = wpfHexViewMarginProviderCollectionProvider;
     this.editorOperationsFactoryService             = editorOperationsFactoryService;
 }
 MouseWpfHexViewCreationListener(HexEditorOperationsFactoryService editorOperationsFactoryService, [ImportMany] IEnumerable <Lazy <HexMouseProcessorProvider, IOrderableTextViewRoleMetadata> > mouseProcessorProviders)
 {
     this.editorOperationsFactoryService = editorOperationsFactoryService;
     this.mouseProcessorProviders        = VSUTIL.Orderer.Order(mouseProcessorProviders).ToArray();
 }