Comments out a span of source using line comments.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'宣言
Public Overridable Function CommentLines ( _
span As TextSpan, _
lineComment As String _
) As TextSpan
'使用
Dim instance As Source
Dim span As TextSpan
Dim lineComment As String
Dim returnValue As TextSpan
returnValue = instance.CommentLines(span, _
lineComment)
public virtual TextSpan CommentLines(
TextSpan span,
string lineComment
)
public:
virtual TextSpan CommentLines(
TextSpan span,
String^ lineComment
)
public function CommentLines(
span : TextSpan,
lineComment : String
) : TextSpan
Parameters
span
Type: Microsoft.VisualStudio.TextManager.Interop.TextSpanA TextSpan object describing the span to put into line comments.
lineComment
Type: System.StringThe string that specifies the line comment character or characters.
Return Value
Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan
Returns a TextSpan object encompassing the entire commented block, including the added line comment start string.
Remarks
Prefaces all lines in span with the line comment string.
The base method skips leading whitespace on each line before inserting the line comment string. This method is typically called from the CommentSpan method.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.