Пример #1
0
        /// <summary>
        /// Gets the start visual column from the specified text line.
        /// </summary>
        public int GetTextLineVisualStartColumn(TextLine textLine)
        {
            if (!TextLines.Contains(textLine))
            {
                throw new ArgumentException("textLine is not a line in this VisualLine");
            }

            return(TextLines.TakeWhile(tl => tl != textLine).Sum(tl => tl.Length));
        }
Пример #2
0
        /// <summary>
        /// Gets the start visual column from the specified text line.
        /// </summary>
        public int GetTextLineVisualStartColumn(TextLine textLine)
        {
            if (!TextLines.Contains(textLine))
            {
                throw new ArgumentException("textLine is not a line in this VisualLine");
            }
            int col = 0;

            foreach (TextLine tl in TextLines)
            {
                if (tl == textLine)
                {
                    break;
                }
                else
                {
                    col += tl.Length;
                }
            }
            return(col);
        }