Alsing.Windows.Forms.SyntaxBox.Caret.GetWord C# (CSharp) Method

GetWord() public method

public GetWord ( int countBefore ) : Word
countBefore int
return Alsing.SourceCode.Word
        public Word GetWord(int countBefore)
        {
            Word word = CurrentWord;

            Row row = Control.Caret.CurrentRow;

            int index = row.words.IndexOf(word);

            if (index >= countBefore)
            {
                return row.words[index - countBefore];
            }
            else
            {
                return null;
            }

            return CurrentWord;
        }