public TextDocumentAccessor(TextDocument document) { if (document == null) throw new ArgumentNullException("document"); doc = document; minLine = 1; maxLine = doc.LineCount; }