コード例 #1
0
ファイル: TextLineWalker.cs プロジェクト: brezza92/PixelFarm
        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);
                    }
                }
            }
        }
コード例 #2
0
ファイル: TextLineWalker.cs プロジェクト: brezza92/PixelFarm
 public char DoDeleteOneChar()
 {
     if (CharIndex < CurrentLine.CharCount())
     {
         //simulate backspace keystroke
         SetCurrentCharStepRight();
         return(BackSpaceOneChar());
     }
     else
     {
         return('\0');
     }
 }