コード例 #1
0
        /// <summary>
        /// Calculates screen line/column index from char-index.
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException">Specified index was out of range.</exception>
        public override void GetLineColumnIndexFromCharIndex(int charIndex, out int lineIndex, out int columnIndex)
        {
            if (charIndex < 0 || Document.Length < charIndex)
            {
                throw new ArgumentOutOfRangeException("charIndex", "Invalid index was given (charIndex:" + charIndex + ", document.Length:" + Document.Length + ").");
            }

            LineLogic.GetLineColumnIndexFromCharIndex(
                Document.InternalBuffer, PLHI, charIndex, out lineIndex, out columnIndex
                );
        }
コード例 #2
0
        /// <summary>
        /// Calculates location in the virtual space of the character at specified index.
        /// </summary>
        /// <returns>The location of the character at specified index.</returns>
        /// <exception cref="ArgumentOutOfRangeException">Specified index was out of range.</exception>
        public override Point GetVirPosFromIndex(IGraphics g, int index)
        {
            int line, column;

            LineLogic.GetLineColumnIndexFromCharIndex(
                Document.InternalBuffer,
                PLHI,
                index,
                out line,
                out column
                );

            return(GetVirPosFromIndex(g, line, column));
        }