Table of Contents

Class TagProcessorManager

Namespace
TMPEffects.TextProcessing
Assembly
TMPEffects.dll

Manages multiple TagProcessor.

public class TagProcessorManager : ITagProcessorManager, IEnumerable<TagProcessor>, IEnumerable
Inheritance
TagProcessorManager
Implements
Inherited Members

Constructors

TagProcessorManager()

public TagProcessorManager()

Properties

TagProcessors

Mapping of prefix to list of TagProcessor.

public ReadOnlyDictionary<char, ReadOnlyCollection<TagProcessor>> TagProcessors { get; }

Property Value

ReadOnlyDictionary<char, ReadOnlyCollection<TagProcessor>>

Methods

AddProcessor(char, TagProcessor, int)

Add a processor.

public void AddProcessor(char prefix, TagProcessor processor, int priority = 0)

Parameters

prefix char

Prefix of tags processed by processor.

processor TagProcessor

The processor.

priority int

Priority of this processor. Only one processors can process any given tag, so the order that processors are invoked in matters.
Less than zero => last processed
zero => first processed (highest priority)
Greater than zero => priority-th processed
Greater than current amount of processors => last processed

Clear()

Remove all processors.

public void Clear()

GetEnumerator()

Get all TagProcessor managed by this instance.

public IEnumerator<TagProcessor> GetEnumerator()

Returns

IEnumerator<TagProcessor>

All TagProcessor managed by this instance.

RegisterTo(TMPTextProcessor)

Register all TagProcessor to the given textProcessor.

public void RegisterTo(TMPTextProcessor textProcessor)

Parameters

textProcessor TMPTextProcessor

The TMPTextProcessor to register to.

RemoveProcessor(char, TagProcessor)

Remove a processor.

public bool RemoveProcessor(char prefix, TagProcessor processor)

Parameters

prefix char

Prefix of tags processed by processor.

processor TagProcessor

The processor.

Returns

bool

true if the processors was removed; otherwise false.

UnregisterFrom(TMPTextProcessor)

Unregister all TagProcessor from the given textProcessor.

public void UnregisterFrom(TMPTextProcessor textProcessor)

Parameters

textProcessor TMPTextProcessor

The TMPTextProcessor to unregister from.