public HexBoxState(HexBoxState other) { this.TopOffset = other.TopOffset; this.Column = other.Column; this.StartOffset = other.StartOffset; this.EndOffset = other.EndOffset; this.CaretPosition = other.CaretPosition; this.Selection = other.Selection; }
public void SetCaret(HexBoxPosition position, double horizOffset, Rect?hexByteCaret, Rect?asciiCaret) { if (position == Position && this.horizOffset == horizOffset && hexByteInfo.Rect == hexByteCaret && asciiInfo.Rect == asciiCaret) { return; } this.position = position; this.horizOffset = horizOffset; hexByteInfo.Initialize(hexByteCaret, position.Kind == HexBoxPositionKind.HexByte); asciiInfo.Initialize(asciiCaret, position.Kind == HexBoxPositionKind.Ascii); geometriesCreated = false; // Make sure caret doesn't blink when it's moving. It looks weird when quickly moving up/down blinkIsVisible = true; Redraw(); }