SnapshotSpan entireSnapshotSpan = new SnapshotSpan(textSnapshot, 0, textSnapshot.Length);
int lineNumber = 5; ITextSnapshotLine line = textSnapshot.GetLineFromLineNumber(lineNumber); SnapshotSpan lineSnapshotSpan = line.Extent;
int lineNumber = 5; int columnStart = 10; int columnEnd = 20; ITextSnapshotLine line = textSnapshot.GetLineFromLineNumber(lineNumber); SnapshotSpan columnSnapshotSpan = new SnapshotSpan(line.Start + columnStart, columnEnd - columnStart);These examples demonstrate the versatility of the SnapshotSpan class and its ability to represent various spans of text in an editor snapshot. These examples are part of the Microsoft.VisualStudio.Text.dll package library.