ClassWordTaggerBase
Base tagger class for classification of words.
Definition
Namespace:Telerik.Windows.Controls.SyntaxEditor.Tagging.Taggers
Assembly:Telerik.Windows.Controls.SyntaxEditor.dll
Syntax:
public abstract class WordTaggerBase : TaggerBase<ClassificationTag>, ITagger<ClassificationTag>
Inheritance: objectTaggerBase<ClassificationTag>WordTaggerBase
Derived Classes:
Implements:
Inherited Members
Constructors
WordTaggerBase(RadSyntaxEditor)
Initializes a new instance of the WordTaggerBase class.
Declaration
protected WordTaggerBase(RadSyntaxEditor editor)
Parameters
editor
The editor.
Properties
EnableMultilineTags
Gets or sets a value indicating whether multiline tags are collected by this tagger instance. The method RebuildMultilineTags() process all document and collects Multiline tags in the MultilineTags property.
MultilineTags
The list of multiline ClassificationTags wrapped in TagSpans.
Declaration
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
protected IList<TagSpan<ClassificationTag>> MultilineTags { get; }
Property Value
IList<TagSpan<ClassificationTag>>
StringMatchingRegex
Gets or sets the regex pattern used to match strings in the documents which this tagger recognizes.
Declaration
protected virtual string StringMatchingRegex { get; set; }
Property Value
Methods
AddWord(string, ClassificationType)
Adds a new word-type pair in the dictionary.
Declaration
public void AddWord(string word, ClassificationType classificationType)
Parameters
word
classificationType
GetCharType(char)
Defines the different char types which is the essence of splitting words. A word is considered sequence of equally typed chars. 1 - whitespace, 2 - punctuation or symbol, 0 - letters and all other characters.
GetTags(NormalizedSnapshotSpanCollection)
Gets the tags.
Declaration
public override IEnumerable<TagSpan<ClassificationTag>> GetTags(NormalizedSnapshotSpanCollection spans)
Parameters
spans
Returns
IEnumerable<TagSpan<ClassificationTag>>
Overrides
GetWordsToClassificationTypes()
Gets the words to classification types.
Declaration
protected abstract Dictionary<string, ClassificationType> GetWordsToClassificationTypes()
Returns
Dictionary<string, ClassificationType>
Dictionary<System.String, ClassificationType>.
InvalidateMultilineTags()
Clears all multiline tags and rebuilds them.
Declaration
protected virtual void InvalidateMultilineTags()
OnWordSplit(int, string)
Called when a word is split during processing of a line string.
RebuildMultilineTags()
Rebuilds the MultilineTags collection.
Declaration
protected virtual void RebuildMultilineTags()
SplitIntoWords(string)
Splits the given string into collection of words.
TryGetClassificationType(string, out ClassificationType)
Tries to get the classification type for the given string word.
Declaration
protected virtual bool TryGetClassificationType(string word, out ClassificationType classificationType)
Parameters
word
The string word.
classificationType
The result classification type.
Returns
Returns true if classification type is found, otherwise - false.
TryRemoveWord(string)
Tries to removes a given word from the dictionary.