Class
WordTaggerBase

Base tagger class for classification of words.

Definition

Namespace:Telerik.Windows.Controls.SyntaxEditor.Tagging.Taggers

Assembly:Telerik.Windows.Controls.SyntaxEditor.dll

Syntax:

cs-api-definition
public abstract class WordTaggerBase : TaggerBase<ClassificationTag>, ITagger<ClassificationTag>

Inheritance: objectTaggerBase<ClassificationTag>WordTaggerBase

Derived Classes: JavaScriptTaggerSqlTaggerCSharpTaggerVisualBasicTagger

Implements: ITagger<ClassificationTag>

Inherited Members TaggerBase<ClassificationTag>.CallOnTagsChanged(Span)TaggerBase<ClassificationTag>.OnTagsChanged(TagsChangedEventArgs)TaggerBase<ClassificationTag>.EditorTaggerBase<ClassificationTag>.DocumentTaggerBase<ClassificationTag>.TagsChanged

Constructors

WordTaggerBase(RadSyntaxEditor)

Initializes a new instance of the WordTaggerBase class.

Declaration

cs-api-definition
protected WordTaggerBase(RadSyntaxEditor editor)

Parameters

editor

RadSyntaxEditor

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.

Declaration

cs-api-definition
public bool EnableMultilineTags { get; set; }

Property Value

bool

MultilineTags

The list of multiline ClassificationTags wrapped in TagSpans.

Declaration

cs-api-definition
[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

cs-api-definition
protected virtual string StringMatchingRegex { get; set; }

Property Value

string

Methods

AddWord(string, ClassificationType)

Adds a new word-type pair in the dictionary.

Declaration

cs-api-definition
public void AddWord(string word, ClassificationType classificationType)

Parameters

word

string

classificationType

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.

Declaration

cs-api-definition
protected virtual int GetCharType(char character)

Parameters

character

char

Returns

int

GetTags(NormalizedSnapshotSpanCollection)

Gets the tags.

Declaration

cs-api-definition
public override IEnumerable<TagSpan<ClassificationTag>> GetTags(NormalizedSnapshotSpanCollection spans)

Parameters

spans

NormalizedSnapshotSpanCollection

Returns

IEnumerable<TagSpan<ClassificationTag>>

Overrides TaggerBase<ClassificationTag>.GetTags(NormalizedSnapshotSpanCollection)

GetWordsToClassificationTypes()

Gets the words to classification types.

Declaration

cs-api-definition
protected abstract Dictionary<string, ClassificationType> GetWordsToClassificationTypes()

Returns

Dictionary<string, ClassificationType>

Dictionary<System.String, ClassificationType>.

InvalidateMultilineTags()

Clears all multiline tags and rebuilds them.

Declaration

cs-api-definition
protected virtual void InvalidateMultilineTags()

OnWordSplit(int, string)

Called when a word is split during processing of a line string.

Declaration

cs-api-definition
protected virtual void OnWordSplit(int wordCharType, string word)

Parameters

wordCharType

int

word

string

RebuildMultilineTags()

Rebuilds the MultilineTags collection.

Declaration

cs-api-definition
protected virtual void RebuildMultilineTags()

SplitIntoWords(string)

Splits the given string into collection of words.

Declaration

cs-api-definition
protected virtual IList<string> SplitIntoWords(string value)

Parameters

value

string

The given string to split.

Returns

IList<string>

List of the words.

TryGetClassificationType(string, out ClassificationType)

Tries to get the classification type for the given string word.

Declaration

cs-api-definition
protected virtual bool TryGetClassificationType(string word, out ClassificationType classificationType)

Parameters

word

string

The string word.

classificationType

ClassificationType

The result classification type.

Returns

bool

Returns true if classification type is found, otherwise - false.

TryRemoveWord(string)

Tries to removes a given word from the dictionary.

Declaration

cs-api-definition
public bool TryRemoveWord(string word)

Parameters

word

string

Returns

bool