void UpdateEnabled() { var newEnabled = wpfHexView.Options.HighlightActiveColumn(); if (newEnabled == enabled) { return; } enabled = newEnabled; if (enabled) { if (adornmentLayer is null) { adornmentLayer = wpfHexView.GetAdornmentLayer(PredefinedHexAdornmentLayers.ActiveColumnHighlighter); } HookEnabledEvents(); } else { UnhookEnabledEvents(); } DelayRecreateRectangles(); }
void UpdateEnableState() { enabled = wpfHexView.Options.IsHighlightCurrentLineEnabled(); if (enabled) { if (adornmentLayer is null) { adornmentLayer = wpfHexView.GetAdornmentLayer(PredefinedHexAdornmentLayers.CurrentLineHighlighter); } if (!hasHookedEvents) { RegisterEnabledEvents(); isActive = wpfHexView.HasAggregateFocus; selectionIsEmpty = wpfHexView.Selection.IsEmpty; isActive = wpfHexView.HasAggregateFocus; UpdateLineElementBrushes(); PositionLineElement(); } } else { adornmentLayer?.RemoveAllAdornments(); if (hasHookedEvents) { UnregisterEnabledEvents(); } } }
void UpdateEnabled() { var newEnabled = wpfHexView.Options.ShowColumnLines(); if (newEnabled == enabled) { return; } enabled = newEnabled; if (enabled) { if (adornmentLayer is null) { adornmentLayer = wpfHexView.GetAdornmentLayer(PredefinedHexAdornmentLayers.ColumnLineSeparator); } HookEnabledEvents(); } else { UnhookEnabledEvents(); } DelayRecreateColumnLines(); }
protected override void OnEnabledCore() { if (adornmentLayer is null) { adornmentLayer = wpfHexView.GetAdornmentLayer(PredefinedHexAdornmentLayers.BackgroundImage); } wpfHexView.LayoutChanged += WpfHexView_LayoutChanged; }