Click or drag to resize
FormatCommenter.TryUncommentLines Method
Attempt to uncomment a span of text using any of a collection of line comment formats.

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 bool TryUncommentLines(
	VirtualSnapshotSpan span,
	ITextEdit edit,
	ReadOnlyCollection<LineCommentFormat> formats,
	out VirtualSnapshotSpan result
)

Parameters

span
Type: Microsoft.VisualStudio.Text.VirtualSnapshotSpan
The span of text to uncomment.
edit
Type: Microsoft.VisualStudio.Text.ITextEdit
The ITextEdit instance to use for applying changes.
formats
Type: System.Collections.ObjectModel.ReadOnlyCollection<LineCommentFormat>
The line comment formats to use for attempting to uncomment the code.
result
Type: Microsoft.VisualStudio.Text.VirtualSnapshotSpan
Upon return, a VirtualSnapshotSpan containing the uncommented code.

Return Value

Type: Boolean

true if one or more lines of the span of text were successfully uncommented using one of the specified line comment formats.

-or-

false if none of the lines in the span of text could be uncommented using any of the specified formats.

Exceptions
ExceptionCondition
ArgumentNullException

If edit is null.

-or-

If formats is null.

ArgumentExceptionIf formats contains any null values.
See Also