DefaultWordBreakFinder Class
Provides the default implementation of an object that finds word breaks within an ITextSnapshot.
public class DefaultWordBreakFinder : IWordBreakFinder
- Inheritance:
- object object
- Implements:
- IWordBreakFinder
Remarks
Instances of this object can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an instance is registered with the language for the IWordBreakFinder interface type, its features can be used by the language.
Constructors
DefaultWordBreakFinder()
Initializes a new instance of the DefaultWordBreakFinder
class.
public DefaultWordBreakFinder()
Remarks
The default constructor initializes all fields to their default values.
Properties
DefaultWordContainsAdditionalCharacters
Gets the default CharClass for the WordContainsAdditionalCharacters property.
public static CharClass DefaultWordContainsAdditionalCharacters { get; }
Property Value
- CharClass:
The default CharClass for the WordContainsAdditionalCharacters property.
DefaultWordStandaloneCharacters
Gets the default CharClass for the WordStandaloneCharacters property.
public static CharClass DefaultWordStandaloneCharacters { get; }
Property Value
- CharClass:
The default CharClass for the WordStandaloneCharacters property.
WordContainsAdditionalCharacters
Gets or sets the set of additional characters that can constitute the inside of a word, other than letters and digits.
public CharClass WordContainsAdditionalCharacters { get; set; }
Property Value
- CharClass:
The set of additional characters that can constitute the inside of a word, other than letters and digits.
Remarks
The default value is the _
character.
WordStandaloneCharacters
Gets or sets the set of characters that are intended to be single character words.
public CharClass WordStandaloneCharacters { get; set; }
Property Value
- CharClass:
The set of characters that are intended to be single character words.
Remarks
The default value is the set of .,()<>[]{}?!/:;'"
characters.
Methods
FindCurrentWordEnd(TextSnapshotOffset)
Returns the ITextSnapshot offset of the word end character that occurs at or after the specified start offset.
public int FindCurrentWordEnd(TextSnapshotOffset snapshotOffset)
Parameter | Type | Description |
---|---|---|
snapshotOffset | TextSnapshotOffset | The TextSnapshotOffset from which to start parsing. |
Returns
- int:
The ITextSnapshot offset of the word end character that occurs at or after the specified start offset.
FindCurrentWordStart(TextSnapshotOffset)
Returns the ITextSnapshot offset of the word start character that occurs at or before the specified start offset.
public int FindCurrentWordStart(TextSnapshotOffset snapshotOffset)
Parameter | Type | Description |
---|---|---|
snapshotOffset | TextSnapshotOffset | The TextSnapshotOffset from which to start parsing. |
Returns
- int:
The ITextSnapshot offset of the word start character that occurs at or before the specified start offset.
FindNextWordStart(TextSnapshotOffset)
Returns the ITextSnapshot offset of the word start character that occurs after the specified start offset.
public int FindNextWordStart(TextSnapshotOffset snapshotOffset)
Parameter | Type | Description |
---|---|---|
snapshotOffset | TextSnapshotOffset | The TextSnapshotOffset from which to start parsing. |
Returns
- int:
The ITextSnapshot offset of the word start character that occurs after the specified start offset.
FindPreviousWordStart(TextSnapshotOffset)
Returns the ITextSnapshot offset of the word start character that occurs before the specified start offset.
public int FindPreviousWordStart(TextSnapshotOffset snapshotOffset)
Parameter | Type | Description |
---|---|---|
snapshotOffset | TextSnapshotOffset | The TextSnapshotOffset from which to start parsing. |
Returns
- int:
The ITextSnapshot offset of the word start character that occurs before the specified start offset.