void UpdateEnableState() { enabled = wpfHexView.Options.IsHighlightCurrentLineEnabled(); if (enabled) { if (adornmentLayer == 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 RemoveAllMarkerElements() { // Clear this first so the remove-callback won't try to remove anything from this list (it'll be empty!) markerElements.Clear(); negativeTextMarkerAdornmentLayer.RemoveAllAdornments(); textMarkerAdornmentLayer.RemoveAllAdornments(); }
void PositionLineElement() { if (!selectionIsEmpty || !enabled) { adornmentLayer?.RemoveAllAdornments(); return; } var line = wpfHexView.Caret.ContainingHexViewLine; if (line.IsVisible()) { if (adornmentLayer.IsEmpty) { adornmentLayer.AddAdornment(VSTE.AdornmentPositioningBehavior.OwnerControlled, (HexBufferSpan?)null, null, currentLineHighlighterElement, null); } Canvas.SetLeft(currentLineHighlighterElement, wpfHexView.ViewportLeft); Canvas.SetTop(currentLineHighlighterElement, line.TextTop); currentLineHighlighterElement.SetLine(line, wpfHexView.ViewportWidth); } else { adornmentLayer.RemoveAllAdornments(); } }
protected override void OnDisabledCore() { wpfHexView.LayoutChanged -= WpfHexView_LayoutChanged; if (adornmentLayer != null) { adornmentLayer.RemoveAllAdornments(); } }
void WpfHexView_Closed(object sender, EventArgs e) { wpfHexView.Closed -= WpfHexView_Closed; wpfHexView.LayoutChanged -= WpfHexView_LayoutChanged; wpfHexView.Selection.SelectionChanged -= Selection_SelectionChanged; tagAggregator.TagsChanged -= TagAggregator_TagsChanged; tagAggregator.Dispose(); adornmentTagInfos.Clear(); layer?.RemoveAllAdornments(); }
void RemoveAllLines() { adornmentLayer?.RemoveAllAdornments(); lineElements.Clear(); }
void RemoveAdornment() => layer.RemoveAllAdornments();
void RemoveAllRectangles() { adornmentLayer?.RemoveAllAdornments(); rectangleElements.Clear(); }
void RemoveAllAdornments() { layer.RemoveAllAdornments(); markerElement = null; }