public static void RemoveText(this ITextDocument document, ISegment segment) { if (document == null) { throw new ArgumentNullException("document"); } document.RemoveText(segment.Offset, segment.Length); }