예제 #1
0
        /// <summary>
        /// 设置光标当前位置  从(0,0)开始
        /// </summary>
        /// <param name="line"></param>
        /// <param name="col"></param>
        /// <returns>VSConstants.S_OK表示成功,S_FALSE失败</returns>
        public int SetCursorPositon(int line, int col)
        {
            if (ActiveTextView != null)
            {
                return(ActiveTextView.SetCaretPos(line, col));
            }

            return(VSConstants.S_FALSE);
        }
예제 #2
0
        /// <summary>
        /// 将光标移动到指定位置(从(0,0)开始)
        /// </summary>
        /// <param name="line"></param>
        /// <param name="col"></param>
        public void MoveCursorTo(int line, int col)
        {
            if (line < 0 || col < 0)
            {
                return;
            }

            if (ActiveTextView != null)
            {
                ActiveTextView.SetCaretPos(line, col);
            }
        }