Represents an object that can comment and uncomment lines over a particular range.
- Inheritance:
- object object
- Derived:
-
Xml
Line Commenter
- Implements:
-
ILine
Commenter
Remarks
The Start
The start delimiter is added/removed from the start of the range. The end delimiter is added/removed from the end of the range.
Instances of this object can be registered with an ISyntax
Constructors
RangeLineCommenter()
Initializes an instance of the class.
Properties
CommentTokenId
Gets or sets the comment token ID.
Property Value
- int?:
The comment token ID.
Remarks
If a token ID is specified for the comment, it can be used to help locate a surrounding comment when uncommenting.
EndDelimiter
Gets or sets the end delimiter text that is added or removed during comment/uncomment operations.
Property Value
- string:
The end delimiter text that is added or removed during comment/uncomment operations.
Remarks
For instance, in XML
the end delimiter would be -->
.
StartDelimiter
Gets or sets the start delimiter text that is added or removed during comment/uncomment operations.
Property Value
- string:
The start delimiter text that is added or removed during comment/uncomment operations.
Remarks
For instance, in XML
the start delimiter would be <!--
.
Methods
Comment(ITextSnapshot, ITextPositionRangeCollection, ITextChangeOptions)
Comments out the lines of code in the specified position ranges.
Parameter | Type | Description |
---|---|---|
snapshot | IText |
The target IText |
positionRanges | IText |
The IText |
options | IText |
The IText |
FindCommentTextRange(TextSnapshotRange)
Returns the full text range of the comment that surrounds the specified snapshot range, if any.
Parameter | Type | Description |
---|---|---|
snapshotRange | Text |
The Text |
Returns
- Text
Range ?: The full text range of the comment that surrounds the specified snapshot range, if any.
Uncomment(ITextSnapshot, ITextPositionRangeCollection, ITextChangeOptions)
Uncomments the lines of code in the specified position ranges.
Parameter | Type | Description |
---|---|---|
snapshot | IText |
The target IText |
positionRanges | IText |
The IText |
options | IText |
The IText |