Partilhar via


Source.CommentBlock(TextSpan, String, String) Method

Definition

Called from Comment Selection. Default behavior is to insert block style comments at beginning and end of selection. Override to add custome behavior.

public:
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan CommentBlock(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, System::String ^ blockStart, System::String ^ blockEnd);
public:
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan CommentBlock(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, Platform::String ^ blockStart, Platform::String ^ blockEnd);
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan CommentBlock(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, std::wstring const & blockStart, std::wstring const & blockEnd);
public virtual Microsoft.VisualStudio.TextManager.Interop.TextSpan CommentBlock (Microsoft.VisualStudio.TextManager.Interop.TextSpan span, string blockStart, string blockEnd);
abstract member CommentBlock : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string * string -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
override this.CommentBlock : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string * string -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
Public Overridable Function CommentBlock (span As TextSpan, blockStart As String, blockEnd As String) As TextSpan

Parameters

span
TextSpan

A TextSpan object describing the span of source to put into a block comment.

blockStart
String

A string that specifies the block comment start character or characters.

blockEnd
String

A string that specifies the block comment end character or characters.

Returns

The final span of the commented block including the comment delimiters

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.

Applies to