Click or drag to resize
FormatCommenterCommentLines Method
Comment out a span using a particular line comment format. If the span is empty, the entire line containing the span's start point is commented.

Namespace: Tvl.VisualStudio.Text.Commenter
Assembly: Tvl.VisualStudio.Commenter.Utility.10 (in Tvl.VisualStudio.Commenter.Utility.10.dll) Version: 1.0.0.0
Syntax
protected virtual VirtualSnapshotSpan CommentLines(
	VirtualSnapshotSpan span,
	ITextEdit edit,
	LineCommentFormat format
)

Parameters

span
Type: Microsoft.VisualStudio.TextVirtualSnapshotSpan
The span of text to comment.
edit
Type: Microsoft.VisualStudio.TextITextEdit
The ITextEdit to apply the changes to.
format
Type: Tvl.VisualStudio.Text.CommenterLineCommentFormat
The line comment format to use for commenting the code.

Return Value

Type: VirtualSnapshotSpan
A VirtualSnapshotSpan containing the commented code.
Exceptions
ExceptionCondition
ArgumentNullException

If edit is .

-or-

If format is .

Remarks

The default algorithm for line comments is designed to meet the following conditions.

  • Make sure line comments are indented as far as possible, skipping empty lines as necessary.
  • Don't comment N+1 lines when only N lines were selected by clicking in the left margin.
See Also