public override HexCaretPosition MoveTo(HexCellPosition position, HexMoveToFlags flags) { if (position.IsDefault) { throw new ArgumentException(); } if (!hexView.BufferLines.IsValidPosition(position.BufferPosition)) { throw new ArgumentOutOfRangeException(nameof(position)); } var colPos = CreateColumnPosition(position); return(MoveTo(colPos, flags)); }
HexCaretPosition MoveTo(HexViewLine hexLine, double xCoordinate, HexMoveToFlags flags, bool captureVerticalPosition) { if (hexLine == null) { throw new ArgumentNullException(nameof(hexLine)); } if (hexLine.BufferLine.LineProvider != hexView.BufferLines) { throw new ArgumentException(); } var linePosition = (flags & HexMoveToFlags.InsertionPosition) != 0 ? hexLine.GetInsertionLinePositionFromXCoordinate(xCoordinate) : hexLine.GetVirtualLinePositionFromXCoordinate(xCoordinate); var posInfo = hexLine.BufferLine.GetLinePositionInfo(linePosition); if (posInfo.IsValueCellSeparator) { var posInfo2 = hexLine.BufferLine.GetLinePositionInfo(hexLine.GetInsertionLinePositionFromXCoordinate(xCoordinate)); if (posInfo2.IsValueCell) { posInfo = posInfo2; } } var closestPos = hexLine.BufferLine.GetClosestCellPosition(posInfo, onlyVisibleCells: true); if (closestPos == null) { Debug.Assert(hexView.BufferLines.BufferSpan.Length == 0 || (!IsValuesCaretPresent && !IsAsciiCaretPresent)); closestPos = new HexCellPosition(currentPosition.ActiveColumn, hexLine.BufferStart, 0); } SetExplicitPosition(CreateColumnPosition(closestPos.Value)); if ((flags & HexMoveToFlags.CaptureHorizontalPosition) != 0) { SavePreferredXCoordinate(); } if (captureVerticalPosition) { SavePreferredYCoordinate(); } return(Position); }
public override HexCaretPosition MoveTo(HexColumnPosition position, HexMoveToFlags flags) { if (position.IsDefault) { throw new ArgumentException(); } if (!hexView.BufferLines.IsValidPosition(position.ValuePosition.BufferPosition)) { throw new ArgumentOutOfRangeException(nameof(position)); } if (!hexView.BufferLines.IsValidPosition(position.AsciiPosition.BufferPosition)) { throw new ArgumentOutOfRangeException(nameof(position)); } SetExplicitPosition(position); if ((flags & HexMoveToFlags.CaptureHorizontalPosition) != 0) { SavePreferredXCoordinate(); } SavePreferredYCoordinate(); return(Position); }
/// <summary> /// Move caret to a line /// </summary> /// <param name="hexLine">Line</param> /// <param name="horizontalOffset">Horizontal offset</param> /// <param name="extendSelection">true to extend the selection</param> /// <param name="flags">Flags</param> public abstract void MoveCaret(HexViewLine hexLine, double horizontalOffset, bool extendSelection, HexMoveToFlags flags);
public override HexCaretPosition MoveTo(HexColumnType column, HexBufferPoint position, HexMoveToFlags flags) { if (column != HexColumnType.Values && column != HexColumnType.Ascii) { throw new ArgumentOutOfRangeException(nameof(column)); } if (position.IsDefault) { throw new ArgumentException(); } if (!hexView.BufferLines.IsValidPosition(position)) { throw new ArgumentOutOfRangeException(nameof(position)); } var cellPos = column == HexColumnType.Values ? CreateValuesCellPosition(position) : new HexCellPosition(column, position, 0); var colPos = CreateColumnPosition(cellPos); return(MoveTo(colPos, flags)); }
/// <summary> /// Move caret to a line /// </summary> /// <param name="hexLine">Line</param> /// <param name="horizontalOffset">Horizontal offset</param> /// <param name="extendSelection">true to extend the selection</param> /// <param name="flags">Flags</param> public abstract void MoveCaret(HexViewLine hexLine, double horizontalOffset, bool extendSelection, HexMoveToFlags flags);
public override HexCaretPosition MoveTo(HexViewLine hexLine, double xCoordinate, HexMoveToFlags flags) => MoveTo(hexLine, xCoordinate, flags, true);
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="position">Position</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexColumnPosition position, HexMoveToFlags flags);
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="hexLine">Line</param> /// <param name="xCoordinate">X coordinate</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexViewLine hexLine, double xCoordinate, HexMoveToFlags flags);
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="column">Column</param> /// <param name="position">Position</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexColumnType column, HexBufferPoint position, HexMoveToFlags flags);
public override void MoveCaret(HexViewLine hexLine, double horizontalOffset, bool extendSelection, HexMoveToFlags flags) { if (hexLine == null) throw new ArgumentNullException(nameof(hexLine)); var anchorPoint = GetAnchorPositionOrCaretIfNoSelection(); Caret.MoveTo(hexLine, horizontalOffset, flags); if (extendSelection) SelectToCaret(anchorPoint); else Selection.Clear(); }
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="hexLine">Line</param> /// <param name="xCoordinate">X coordinate</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexViewLine hexLine, double xCoordinate, HexMoveToFlags flags);
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="position">Position</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexColumnPosition position, HexMoveToFlags flags);
/// <summary> /// Moves the caret to a new position /// </summary> /// <param name="column">Column</param> /// <param name="position">Position</param> /// <param name="flags">Flags</param> /// <returns></returns> public abstract HexCaretPosition MoveTo(HexColumnType column, HexBufferPoint position, HexMoveToFlags flags);