Click or drag to resize
FormatCommenter Class
This class provides a default implementation of ICommenter that provides standard comment and uncomment handling for languages supporting one or more comment formats.
Inheritance Hierarchy
SystemObject
  Tvl.VisualStudio.Text.CommenterFormatCommenter

Namespace: Tvl.VisualStudio.Text.Commenter
Assembly: Tvl.VisualStudio.Commenter.Utility.10 (in Tvl.VisualStudio.Commenter.Utility.10.dll) Version: 1.0.0.0
Syntax
public class FormatCommenter : ICommenter

The FormatCommenter type exposes the following members.

Constructors
  NameDescription
Public methodFormatCommenter(ITextBuffer, IEnumerableCommentFormat)
Initializes a new instance of the FormatCommenter class for the specified text buffer, undo history, and comment formats.
Public methodFormatCommenter(ITextBuffer, CommentFormat)
Initializes a new instance of the FormatCommenter class for the specified text buffer, undo history, and comment formats.
Top
Methods
  NameDescription
Protected methodCommentBlock
Comment out a span of text using the specified block comment format. If the span is empty, the entire line containing the span's start point is commented.
Protected methodCommentLines
Comment out a span using a particular line comment format. If the span is empty, the entire line containing the span's start point is commented.
Protected methodCommentSpan
Comment out the code in a single VirtualSnapshotSpan.
Public methodCommentSpans
Comments out spans of code.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodStatic memberScanToNonWhitespaceChar
Gets the index of the first non-whitespace character on a line, or the length of the line if the line is empty or only contains whitespace.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodStatic memberTrimSpan
Update the specified span to not include any leading or trailing whitespace characters.
Protected methodTryUncommentBlock(VirtualSnapshotSpan, ITextEdit, ReadOnlyCollectionBlockCommentFormat, VirtualSnapshotSpan)
Attempt to uncomment a span of text using any of a collection of block comment formats.
Protected methodTryUncommentBlock(VirtualSnapshotSpan, ITextEdit, BlockCommentFormat, VirtualSnapshotSpan)
Attempt to uncomment a span of text using a particular block comment format.
Protected methodTryUncommentLines
Attempt to uncomment a span of text using any of a collection of line comment formats.
Protected methodUncommentSpan
Uncomment the span of text.
Public methodUncommentSpans
Uncomments spans of code.
Top
Properties
  NameDescription
Public propertyBlockFormats
Gets a collection of block comment formats recognized by this commenter.
Public propertyCommentFormats
Gets a collection of all comment formats recognized by this commenter.
Public propertyLineFormats
Gets a collection of line comment formats recognized by this commenter.
Public propertyPreferredBlockFormat
Gets the preferred BlockCommentFormat to use when creating new block comments.
Public propertyPreferredLineFormat
Gets the preferred LineCommentFormat to use when creating new line comments.
Public propertyTextBuffer
Gets the underlying ITextBuffer for this commenter.
Public propertyUseLineComments
Gets whether the commenter should prefer to use line comments when commenting selections of code.
Top
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also