New to Telerik UI for WPF? Start a free 30-day trial

Base class for collecting folding (collapsible) sections in document. Override this class and add ExpandableRegionDefinitions to define the start / end matching rules of a collapsible section.

Definition

Namespace:Telerik.Windows.Controls.SyntaxEditor.Taggers

Assembly:Telerik.Windows.Controls.SyntaxEditor.dll

Syntax:

C#
public class FoldingTaggerBase : TaggerBase<FoldingRegionTag>, ITagger<FoldingRegionTag>

Inheritance: objectTaggerBase<FoldingRegionTag>FoldingTaggerBase

Derived Classes: BracketFoldingTaggerVisualBasicFoldingTaggerXmlFoldingTagger

Implements: ITagger<FoldingRegionTag>

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

Constructors

Initializes a new instance of the FoldingTaggerBase class.

C#
public FoldingTaggerBase(ITextDocumentEditor editor)
Parameters:editorITextDocumentEditor

The syntax editor.

Properties

The FoldingRegionDefinitions that this tagger will use for matching the collapsible regions in the document.

C#
public IList<FoldingRegionDefinition> FoldingRegionDefinitions { get; }

List of all FoldingRegionTags wrapped in TagSpans.

C#
protected IList<TagSpan<FoldingRegionTag>> FoldingRegionTags { get; }

Determines whether the matching between the start and end folding tags is case sensitive.

C#
public bool IsMatchingCaseSensitive { get; set; }

Contains the start / end matching pairs key-value pairs.

C#
protected Dictionary<string, string> RegionsStartToEndMap { get; }

Methods

Prepares patters for matching end of collapsible folding section. Default implementation is to join all end strings of provided collapsible sections. Example for end words End and Finish, pattern is "End|Finish".

C#
protected virtual string BuildEndRegionBlockPattern(Dictionary<string, string> startToEndMap)
Parameters:startToEndMapDictionary<string, string>

Pairs of start/end collapsible section words.

Returns:

string

The end block pattern.

Prepares patters for matching start of collapsible folding section. Default implementation is to join all start strings of provided collapsible sections. Example for start words Start and Move, pattern is "Start|Move".

C#
protected virtual string BuildStartRegionBlockPattern(Dictionary<string, string> startToEndMap)
Parameters:startToEndMapDictionary<string, string>

Pairs of start/end collapsible section words.

Returns:

string

The start block pattern.

Coerces the default provided folding span - span starting from the start of the region's start text and ending in the end of the region's end text.

C#
protected virtual Span CoerceFoldingSpan(Span defaultFoldingSpan)
Parameters:defaultFoldingSpanSpan

The default provided folding span.

Returns:

Span

The coerced folding span.

Gets the text displayed in the collapsed folding section.

C#
protected virtual string GetFoldingRegionTitle(string inputValue, Span span, string startText)
Parameters:inputValuestring

The document string.

spanSpan

The span defining the folded region.

startTextstring

The start text of the collapsible (folding) section.

Returns:

string

The region title.

Gets the folding region's tooltip content.

C#
protected virtual string GetFoldingRegionToolTipContent(Span foldingSpan)
Parameters:foldingSpanSpan

The span starting from the regions' start text and ending after the regions' end text.

Returns:

string

The tooltip content.

Gets the tags.

C#
public override IEnumerable<TagSpan<FoldingRegionTag>> GetTags(NormalizedSnapshotSpanCollection spans)
Parameters:spansNormalizedSnapshotSpanCollection

The spans.

Returns:

IEnumerable<TagSpan<FoldingRegionTag>>

Collection of folding tag spans.

Overrides: TaggerBase<FoldingRegionTag>.GetTags(NormalizedSnapshotSpanCollection)

Clears all collapsible (folding) regions and rebuilds them.

C#
protected virtual void InvalidateFoldingRegions()

Tries to match the not matched start and end tags left from the standard stack matching algorithm.

C#
protected virtual void ProcessNotMatchedTags(IEnumerable<FoldingRegionMatch> startTags, IEnumerable<FoldingRegionMatch> endTags)
Parameters:startTagsIEnumerable<FoldingRegionMatch>

The not matched start tags.

endTagsIEnumerable<FoldingRegionMatch>

The not matched end tags.

Rebuilds the list of all collapsible (folding) regions.

C#
protected virtual void RebuildFoldingRegions()

Prepares the start / end matches for use as key-value pairs.

C#
protected virtual void RefreshStartEndMap()