public void MoveSelectionUp() { if (IsEmpty) { return; } var rect = PrintedTokens .Where(t => t.Token.Index + t.Token.Length <= End) .Select(t => t.Rect) .DefaultIfEmpty(RectangleF.Empty) .Last(); if (rect.IsEmpty) { return; } var tokenAbove = getTokenAbove(new PointF(rect.Right, rect.Top)); Begin = End = tokenAbove?.Index ?? 0; onChanged(); }
public void MoveSelectionDown() { if (IsEmpty) { return; } var rect = PrintedTokens .Where(t => t.Token.Index <= End) .Select(t => t.Rect) .DefaultIfEmpty(RectangleF.Empty) .Last(); if (rect.IsEmpty) { return; } var tokenBelow = getTokenBelow(rect.Location); Begin = End = tokenBelow?.Right ?? Text.Length; onChanged(); }