Udostępnij za pośrednictwem


Source.CommentBlock Method

Comments out a span of source using block comments.

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

Syntax

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

Parameters

  • blockStart
    Type: System.String
    A string that specifies the block comment start character or characters.
  • blockEnd
    Type: System.String
    A string that specifies the block comment end character or characters.

Return Value

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan
A TextSpan object encompassing the entire commented block, including the added comment start and end strings.

Remarks

This method surrounds the specified span with the specified block comment strings.

The base method comments out the specified span and returns a new span that includes the added comment block delimiters. This method is typically called from the CommentSpan method. If the span's extent is zero, then only the first line specified in span is commented out after skipping any leading whitespace on the line.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace