FoldingTaggerBase
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:
public class FoldingTaggerBase : TaggerBase<FoldingRegionTag>, ITagger<FoldingRegionTag>
Inheritance: objectTaggerBase<FoldingRegionTag>FoldingTaggerBase
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the FoldingTaggerBase class.
public FoldingTaggerBase(ITextDocumentEditor editor)
The syntax editor.
Properties
The FoldingRegionDefinitions that this tagger will use for matching the collapsible regions in the document.
public IList<FoldingRegionDefinition> FoldingRegionDefinitions { get; }
FoldingRegionTags
IList<TagSpan<FoldingRegionTag>>
List of all FoldingRegionTags wrapped in TagSpans.
protected IList<TagSpan<FoldingRegionTag>> FoldingRegionTags { get; }
Determines whether the matching between the start and end folding tags is case sensitive.
public bool IsMatchingCaseSensitive { get; set; }
Contains the start / end matching pairs key-value pairs.
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".
protected virtual string BuildEndRegionBlockPattern(Dictionary<string, string> startToEndMap)
Pairs of start/end collapsible section words.
Returns: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".
protected virtual string BuildStartRegionBlockPattern(Dictionary<string, string> startToEndMap)
Pairs of start/end collapsible section words.
Returns: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.
Gets the text displayed in the collapsed folding section.
Gets the tags.
public override IEnumerable<TagSpan<FoldingRegionTag>> GetTags(NormalizedSnapshotSpanCollection spans)
The spans.
Returns:IEnumerable<TagSpan<FoldingRegionTag>>
Collection of folding tag spans.
Overrides:
Clears all collapsible (folding) regions and rebuilds them.
protected virtual void InvalidateFoldingRegions()
Tries to match the not matched start and end tags left from the standard stack matching algorithm.
protected virtual void ProcessNotMatchedTags(IEnumerable<FoldingRegionMatch> startTags, IEnumerable<FoldingRegionMatch> endTags)
The not matched start tags.
endTagsIEnumerable<FoldingRegionMatch>The not matched end tags.
Rebuilds the list of all collapsible (folding) regions.
protected virtual void RebuildFoldingRegions()
Prepares the start / end matches for use as key-value pairs.
protected virtual void RefreshStartEndMap()