void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (e.OldViewState.ViewportHeight != e.NewViewState.ViewportHeight) { UpdateCachedState(); } }
void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { theScrollBar.LargeChange = wpfHexViewHost.HexView.ViewportWidth; theScrollBar.ViewportSize = wpfHexViewHost.HexView.ViewportWidth; UpdateMaximum(); theScrollBar.Value = wpfHexViewHost.HexView.ViewportLeft; }
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (Width != wpfHexView.VisualElement.ActualWidth || Height != wpfHexView.VisualElement.ActualHeight) { Width = wpfHexView.VisualElement.ActualWidth; Height = wpfHexView.VisualElement.ActualHeight; if (layerKind == HexLayerKind.Normal) { // Needed when HW acceleration isn't enabled (virtual machine or remote desktop). // https://msdn.microsoft.com/en-us/library/system.windows.media.visual.visualscrollableareaclip(v=vs.110).aspx // It's ignored if HW acceleration is enabled. // This will reduce the number of bytes sent over the network and should speed up the display // if it's a slow connection. VisualScrollableAreaClip = new Rect(0, 0, Width, Height); } } if (layerKind == HexLayerKind.Normal) { foreach (var layer in adornmentLayers) { layer.OnLayoutChanged(e); } } }
void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (e.NewOrReformattedLines.Count > 0 || e.TranslatedLines.Count > 0 || e.VerticalTranslation) { SetNewSelection(); } }
void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (e.OldViewState.ViewportTop != e.NewViewState.ViewportTop) { Canvas.SetTop(iconCanvas, -wpfHexViewHost.HexView.ViewportTop); } OnNewLayout(e.NewOrReformattedLines, e.TranslatedLines); }
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (e.OldViewState.ViewportWidth != e.NewViewState.ViewportWidth) { UpdateImagePosition(); } else if (e.OldViewState.ViewportHeight != e.NewViewState.ViewportHeight) { UpdateImagePosition(); } }
void UpdateRectanglesPositions(HexViewLayoutChangedEventArgs e) { var d = e.NewViewState.ViewportTop - e.OldViewState.ViewportTop; if (Math.Abs(d) <= 0.001) { return; } foreach (var rectElem in rectangleElements) { Canvas.SetTop(rectElem, Canvas.GetTop(rectElem) + d); } }
void UpdateLineElementPositions(HexViewLayoutChangedEventArgs e) { var d = e.NewViewState.ViewportTop - e.OldViewState.ViewportTop; if (Math.Abs(d) <= 0.001) { return; } foreach (var lineElement in lineElements) { Canvas.SetTop(lineElement, Canvas.GetTop(lineElement) + d); } }
void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { hexCaretLayer.OnLayoutChanged(e); if (savePreferredCoordinates) { savePreferredCoordinates = false; SavePreferredXCoordinate(); SavePreferredYCoordinate(); } if (imeState.CompositionStarted) { MoveImeCompositionWindow(); } }
internal void OnLayoutChanged(HexViewLayoutChangedEventArgs e) { for (int i = adornmentLayerElements.Count - 1; i >= 0; i--) { var elem = adornmentLayerElements[i]; // All adornments that exist in spans that have been removed or in reformatted lines are always removed. if (elem.VisualSpan is not null && (!HexView.HexViewLines.IntersectsBufferSpan(elem.VisualSpan.Value) || GetLine(e.NewOrReformattedLines, GetOverlapsWithSpan(elem.VisualSpan.Value)) is not null)) { adornmentLayerElements.RemoveAt(i); canvas.Children.RemoveAt(i); elem.RemovedCallback?.Invoke(elem.Tag, elem.Adornment); continue; } switch (elem.Behavior) { case VSTE.AdornmentPositioningBehavior.OwnerControlled: break; case VSTE.AdornmentPositioningBehavior.ViewportRelative: Canvas.SetTop(elem.Adornment, ToDefault(Canvas.GetTop(elem.Adornment), 0) + e.NewViewState.ViewportTop - e.OldViewState.ViewportTop); Canvas.SetLeft(elem.Adornment, ToDefault(Canvas.GetLeft(elem.Adornment), 0) + e.NewViewState.ViewportLeft - e.OldViewState.ViewportLeft); break; case VSTE.AdornmentPositioningBehavior.TextRelative: Debug2.Assert(elem.VisualSpan is not null); var translatedLine = GetLine(e.TranslatedLines, GetOverlapsWithSpan(elem.VisualSpan.Value)); if (translatedLine is not null) { // Only y is updated, x is owner controlled Canvas.SetTop(elem.Adornment, ToDefault(Canvas.GetTop(elem.Adornment), 0) + translatedLine.DeltaY); } break; default: throw new InvalidOperationException(); } } }
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { bool recreate = false; if (latestBufferLines != wpfHexView.BufferLines) { recreate = true; } else if (e.OldViewState.ViewportHeight != e.NewViewState.ViewportHeight) { recreate = true; } if (recreate) { RecreateColumnLines(); } else { UpdateLineElementPositions(e); } }
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) => UpdateLines(e.NewOrReformattedLines);
void HexView_LayoutChanged(object?sender, HexViewLayoutChangedEventArgs e) { theScrollBar.LargeChange = scrollMap.ThumbSize; theScrollBar.ViewportSize = scrollMap.ThumbSize; theScrollBar.Value = scrollMap.GetCoordinateAtBufferPosition(FirstVisibleLinePoint); }
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) => PositionLineElement();
internal void OnLayoutChanged(HexViewLayoutChangedEventArgs e) => UpdateCaretProperties();
void WpfHexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) { if (adornmentTagInfos.Count > 0) { currentLineIdentityTags.Clear(); foreach (var line in wpfHexView.HexViewLines) { currentLineIdentityTags.Add(line.IdentityTag); } foreach (var line in e.NewOrReformattedLines) { currentLineIdentityTags.Remove(line.IdentityTag); } for (int i = adornmentTagInfos.Count - 1; i >= 0; i--) { var adornmentInfo = adornmentTagInfos[i]; if (!currentLineIdentityTags.Contains(adornmentInfo.LineIdentityTag)) { layer.RemoveAdornmentsByTag(adornmentInfo); } } currentLineIdentityTags.Clear(); foreach (var line in e.TranslatedLines) { var tags = line.GetAdornmentTags(providerTag); if (tags.Count == 0) { continue; } foreach (var identityTag in tags) { var adornmentInfo = identityTag as AdornmentTagInfo; Debug.Assert(adornmentInfo != null); if (adornmentInfo == null) { continue; } var bounds = line.GetAdornmentBounds(identityTag); Debug.Assert(bounds != null); if (bounds == null) { continue; } adornmentInfo.Initialize(); UpdateAdornmentUIState(line, adornmentInfo, bounds.Value); } } } foreach (var line in e.NewOrReformattedLines) { var tags = line.GetAdornmentTags(providerTag); if (tags.Count == 0) { continue; } foreach (var identityTag in tags) { var adornmentInfo = identityTag as AdornmentTagInfo; Debug.Assert(adornmentInfo != null); if (adornmentInfo == null) { continue; } var bounds = line.GetAdornmentBounds(identityTag); if (bounds == null) { continue; } if (layer == null) { layer = wpfHexView.GetAdornmentLayer(PredefinedHexAdornmentLayers.IntraTextAdornment); // Can't do this in the ctor since Selection hasn't been initialized yet wpfHexView.Selection.SelectionChanged += Selection_SelectionChanged; } adornmentInfo.Initialize(); UpdateAdornmentUIState(line, adornmentInfo, bounds.Value); bool added = AddAdornment(adornmentInfo, line); if (!added) { continue; } adornmentInfo.LineIdentityTag = line.IdentityTag; UpdateIsSelected(adornmentInfo, line); } } }
void HexView_LayoutChanged(object sender, HexViewLayoutChangedEventArgs e) => session.Dismiss();