This snippets returns the content of the current line, where the user has its cursor:
int offset = AvalonEditor.CaretOffset;
DocumentLine line = AvalonEditor.Document.GetLineByOffset(offset);
MessageBox.Show(AvalonEditor.Document.GetText(line.Offset, line.Length));