Alsing.SourceCode.SyntaxDocument.GetFormatWordFromPos C# (CSharp) Метод

GetFormatWordFromPos() публичный Метод

Gets a Word object form a given column , Row index (this only applies if the row is fully parsed)
public GetFormatWordFromPos ( TextPoint p ) : Word
p TextPoint Column and Rowindex
Результат Word
        public Word GetFormatWordFromPos(TextPoint p)
        {
            Row xtr = this[p.Y];
            int CharNo = 0;
            Word CorrectWord = null;
            foreach (Word w in xtr.FormattedWords)
            {
                if (CorrectWord != null)
                {
                    if (w.Text == "")
                        return w;
                    return CorrectWord;
                }

                if (w.Text.Length + CharNo > p.X || w == xtr[xtr.Count - 1])
                {
                    //return w;
                    CorrectWord = w;
                }
                else
                {
                    CharNo += w.Text.Length;
                }
            }
            return CorrectWord;
        }