Exemplo n.º 1
0
        internal bool IsAtCaretCharacterHit(CharacterHit characterHit, int cpFirst)
        {
            // TrailingLength is used as a flag to indicate whether the character
            // hit is on the leading or trailing edge of the character.
            if (characterHit.TrailingLength == 0)
            {
                CharacterHit nextHit = GetNextCaretCharacterHit(characterHit);
                if (nextHit == characterHit)
                {
                    // At this point we only know that no caret stop is available
                    // after the input, we caliberate the input to the end of the line.
                    nextHit = new CharacterHit(cpFirst + Length - 1, 1);
                }

                CharacterHit previousHit = GetPreviousCaretCharacterHit(nextHit);
                return(previousHit == characterHit);
            }
            else
            {
                CharacterHit previousHit = GetPreviousCaretCharacterHit(characterHit);
                CharacterHit nextHit     = GetNextCaretCharacterHit(previousHit);
                return(nextHit == characterHit);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Client to get the distance from the beginning of the line from the specified
 /// character hit.
 /// </summary>
 /// <param name="characterHit">character hit of the character to query the distance.</param>
 /// <returns>distance in text flow direction from the beginning of the line.</returns>
 public abstract double GetDistanceFromCharacterHit(
     CharacterHit characterHit
     );
Exemplo n.º 3
0
 /// <summary>
 /// Client to get the previous character hit for caret navigation
 /// </summary>
 /// <param name="characterHit">the current character hit</param>
 /// <returns>the previous character hit</returns>
 public abstract CharacterHit GetPreviousCaretCharacterHit(
     CharacterHit characterHit
     );
Exemplo n.º 4
0
 /// <summary>
 /// Client to get the previous character hit after backspacing
 /// </summary>
 /// <param name="characterHit">the current character hit</param>
 /// <returns>the character hit after backspacing</returns>
 public abstract CharacterHit GetBackspaceCaretCharacterHit(
     CharacterHit characterHit
     );
Exemplo n.º 5
0
 /// <summary>
 /// Client to get the next character hit for caret navigation
 /// </summary>
 /// <param name="characterHit">the current character hit</param>
 /// <returns>the next character hit</returns>
 public abstract CharacterHit GetNextCaretCharacterHit(
     CharacterHit characterHit
     );