Example #1
0
        public void EnsureCurrentTextRun(int index)
        {
            Run run = CurrentTextRun;

            if (run != null && run.HasParent)
            {
                SetCurrentCharIndex(index);
            }
            else
            {
                if (_needUpdateCurrentRun)
                {
                    SetCurrentCharIndex2(index);
                    _needUpdateCurrentRun = false;
                }
                else
                {
                    SetCurrentCharIndexToBegin();
                    if (index != -1)
                    {
                        int limit = CurrentLine.CharCount();
                        if (index > limit)
                        {
                            index = limit;
                        }
                        SetCurrentCharIndex(index);
                    }
                }
            }
        }
Example #2
0
 public char DoDeleteOneChar()
 {
     if (CharIndex < CurrentLine.CharCount())
     {
         //simulate backspace keystroke
         SetCurrentCharStepRight();
         return(BackSpaceOneChar());
     }
     else
     {
         return('\0');
     }
 }