/// <summary> /// Copy this to <paramref name="other"/> /// </summary> /// <param name="other">Other instance</param> /// <returns></returns> public HexViewCreatorOptions CopyTo(HexViewCreatorOptions other) { if (other == null) throw new ArgumentNullException(nameof(other)); other.MenuGuid = MenuGuid; other.CreateGuidObjects = CreateGuidObjects; return other; }
/// <summary> /// Copy this to <paramref name="other"/> /// </summary> /// <param name="other">Other instance</param> /// <returns></returns> public HexViewCreatorOptions CopyTo(HexViewCreatorOptions other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } other.MenuGuid = MenuGuid; other.CreateGuidObjects = CreateGuidObjects; return(other); }
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, 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, hexBufferLineProviderFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfHexViewCreationListeners, classificationTypeRegistryService); 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, VSTE.ITextViewRoleSet roles, HexViewCreatorOptions options) => Create(buffer, roles, hexEditorOptionsFactoryService.GlobalOptions, options);
public override WpfHexView Create(HexBuffer buffer, HexViewCreatorOptions options) => Create(buffer, DefaultRoles, hexEditorOptionsFactoryService.GlobalOptions, options);
/// <summary> /// Creates a new <see cref="WpfHexView"/> /// </summary> /// <param name="buffer">Buffer</param> /// <param name="options">Options or null</param> /// <returns></returns> public abstract WpfHexView Create(HexBuffer buffer, HexViewCreatorOptions options);
/// <summary> /// Creates a new <see cref="WpfHexView"/> /// </summary> /// <param name="buffer">Buffer</param> /// <param name="roles">Roles</param> /// <param name="parentOptions">Parent options</param> /// <param name="options">Options or null</param> /// <returns></returns> public abstract WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions, HexViewCreatorOptions options);
/// <summary> /// Creates a new <see cref="WpfHexView"/> /// </summary> /// <param name="buffer">Buffer</param> /// <param name="roles">Roles</param> /// <param name="options">Options or null</param> /// <returns></returns> public abstract WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, HexViewCreatorOptions options);