diff --git a/Terminal.Gui/Views/HexView.cs b/Terminal.Gui/Views/HexView.cs index 293fd883e..63955c3f7 100644 --- a/Terminal.Gui/Views/HexView.cs +++ b/Terminal.Gui/Views/HexView.cs @@ -502,6 +502,9 @@ public class HexView : View, IDesignable /// protected virtual void OnPositionChanged (HexViewEventArgs e) { } + /// Event to be invoked when the position and cursor position changes. + public event EventHandler? PositionChanged; + /// public override bool OnProcessKeyDown (Key keyEvent) { @@ -521,15 +524,15 @@ public class HexView : View, IDesignable int value; var k = (char)keyEvent.KeyCode; - if (k >= 'A' && k <= 'F') + if (k is >= 'A' and <= 'F') { value = k - 'A' + 10; } - else if (k >= 'a' && k <= 'f') + else if (k is >= 'a' and <= 'f') { value = k - 'a' + 10; } - else if (k >= '0' && k <= '9') + else if (k is >= '0' and <= '9') { value = k - '0'; } @@ -569,9 +572,6 @@ public class HexView : View, IDesignable return false; } - /// Event to be invoked when the position and cursor position changes. - public event EventHandler? PositionChanged; - /// public override Point? PositionCursor () { @@ -844,7 +844,7 @@ public class HexView : View, IDesignable /// bool IDesignable.EnableForDesign () { - Source = new MemoryStream (Encoding.UTF8.GetBytes ("HexEditor Unicode that shouldn't 𝔹Aℝ𝔽!")); + Source = new MemoryStream (Encoding.UTF8.GetBytes ("HexView data with wide codepoints: 𝔹Aℝ𝔽!")); return true; }