Compartilhar via


Source.CommentLines Method

Comments out a span of source using line comments.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Overridable Function CommentLines ( _
    span As TextSpan, _
    lineComment As String _
) As TextSpan
public virtual TextSpan CommentLines(
    TextSpan span,
    string lineComment
)
public:
virtual TextSpan CommentLines(
    TextSpan span, 
    String^ lineComment
)
abstract CommentLines : 
        span:TextSpan * 
        lineComment:string -> TextSpan  
override CommentLines : 
        span:TextSpan * 
        lineComment:string -> TextSpan
public function CommentLines(
    span : TextSpan, 
    lineComment : String
) : TextSpan

Parameters

  • lineComment
    Type: String

    The 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.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace