public override WpfHexViewHost Create(HexBuffer buffer, string group, string subGroup, Guid?menuGuid) { if (buffer == null) { throw new ArgumentNullException(nameof(buffer)); } if (group == null) { throw new ArgumentNullException(nameof(group)); } if (subGroup == null) { throw new ArgumentNullException(nameof(subGroup)); } var roles = hexEditorFactoryService.CreateTextViewRoleSet(hexEditorFactoryService.DefaultRoles.Concat(new[] { group, subGroup })); var options = new HexViewCreatorOptions { MenuGuid = menuGuid, }; var hexView = hexEditorFactoryService.Create(buffer, roles, options); GetDefaultLocalOptions(hexView).WriteTo(hexView); return(hexEditorFactoryService.CreateHost(hexView, false)); }
public override WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, HexViewCreatorOptions options) => Create(buffer, roles, hexEditorOptionsFactoryService.GlobalOptions, options);
public override WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions, HexViewCreatorOptions options) { if (buffer == null) { throw new ArgumentNullException(nameof(buffer)); } if (roles == null) { throw new ArgumentNullException(nameof(roles)); } if (parentOptions == null) { throw new ArgumentNullException(nameof(parentOptions)); } var wpfHexView = new WpfHexViewImpl(buffer, roles, parentOptions, hexEditorOptionsFactoryService, commandService, formattedHexSourceFactoryService, hexViewClassifierAggregatorService, hexAndAdornmentSequencerFactoryService, hexBufferLineFormatterFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfHexViewCreationListeners, hexViewCreationListeners, classificationTypeRegistryService, hexCursorProviderFactories); if (options?.MenuGuid != null) { var guidObjectsProvider = new GuidObjectsProvider(wpfHexView, options?.CreateGuidObjects); menuService.InitializeContextMenu(wpfHexView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new HexContextMenuInitializer(wpfHexView)); } HexViewCreated?.Invoke(this, new HexViewCreatedEventArgs(wpfHexView)); foreach (var lz in hexEditorFactoryServiceListeners) { lz.Value.HexViewCreated(wpfHexView); } return(wpfHexView); }
public override WpfHexView Create(HexBuffer buffer, HexViewCreatorOptions options) => Create(buffer, DefaultRoles, hexEditorOptionsFactoryService.GlobalOptions, options);