Table of Contents

Class ObservableTagCollection

Namespace
TMPEffects.Tags.Collections
Assembly
TMPEffects.dll

An observable ITagCollection.

public class ObservableTagCollection : TagCollection, ITagCollection, IReadOnlyTagCollection, IReadOnlyCollection<TMPEffectTagTuple>, IEnumerable<TMPEffectTagTuple>, IEnumerable, INotifyCollectionChanged
Inheritance
ObservableTagCollection
Implements
Inherited Members

Constructors

ObservableTagCollection(IList<TMPEffectTagTuple>, ITMPTagValidator)

public ObservableTagCollection(IList<TMPEffectTagTuple> tags, ITMPTagValidator validator = null)

Parameters

tags IList<TMPEffectTagTuple>
validator ITMPTagValidator

ObservableTagCollection(ITMPTagValidator)

public ObservableTagCollection(ITMPTagValidator validator = null)

Parameters

validator ITMPTagValidator

Methods

Clear()

Clear the entire collection.

public override void Clear()

InvokeEvent(NotifyCollectionChangedEventArgs)

protected void InvokeEvent(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

Remove(TMPEffectTag, TMPEffectTagIndices?)

Remove the given tag, with the specified indices (if supplied).

public override bool Remove(TMPEffectTag tag, TMPEffectTagIndices? indices = null)

Parameters

tag TMPEffectTag

The tag to remove.

indices TMPEffectTagIndices?

The indices of the tag.

Returns

bool

true if the tag was removed; false otherwise.

RemoveAllAt(int, TMPEffectTagTuple[], int)

Remove all tags starting at the given startIndex.

public override int RemoveAllAt(int startIndex, TMPEffectTagTuple[] buffer = null, int bufferIndex = 0)

Parameters

startIndex int

The start index.

buffer TMPEffectTagTuple[]

Buffer to save the removed tags into. Leave at default if you do not want to get the tags.

bufferIndex int

The offset index of the buffer, i.e. the index at which the tags should be inserted into buffer.

Returns

int

The amount of removed tags.

RemoveAt(int, int?)

Remove the tag starting at the given startIndex with the correct order.
If order is left to default, the first tag at startIndex will be removed.

public override bool RemoveAt(int startIndex, int? order = null)

Parameters

startIndex int

The start index.

order int?

The order at the start index.

Returns

bool

true if a tag was removed; false otherwise.

TryAdd(TMPEffectTag, int, int, int?)

Attempt to add a new tag to the collection.
If orderAtIndex is left to default, the order will be assigned so it is the first tag at the given startIndex.

public override bool TryAdd(TMPEffectTag tag, int startIndex = 0, int endIndex = -1, int? orderAtIndex = null)

Parameters

tag TMPEffectTag

The tag to add.

startIndex int

The tag's start index.

endIndex int

The tag's end index.

orderAtIndex int?

The tag's order at index.

Returns

bool

true if the tag was successfully added; false otherwise.

TryAdd(TMPEffectTag, TMPEffectTagIndices)

Attempt to add a new tag to the collection.

public override bool TryAdd(TMPEffectTag tag, TMPEffectTagIndices indices)

Parameters

tag TMPEffectTag

The tag to add.

indices TMPEffectTagIndices

The tag's indices.

Returns

bool

true if the tag was successfully added; false otherwise.

Events

CollectionChanged

Raised when the collection changed.

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler