Class ObservableTagCollection
- Namespace
- TMPEffects.Tags.Collections
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
tagsIList<TMPEffectTagTuple>validatorITMPTagValidator
ObservableTagCollection(ITMPTagValidator)
public ObservableTagCollection(ITMPTagValidator validator = null)
Parameters
validatorITMPTagValidator
Methods
Clear()
Clear the entire collection.
public override void Clear()
InvokeEvent(NotifyCollectionChangedEventArgs)
protected void InvokeEvent(NotifyCollectionChangedEventArgs e)
Parameters
Remove(TMPEffectTag, TMPEffectTagIndices?)
Remove the given tag, with the specified indices (if supplied).
public override bool Remove(TMPEffectTag tag, TMPEffectTagIndices? indices = null)
Parameters
tagTMPEffectTagThe tag to remove.
indicesTMPEffectTagIndices?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
startIndexintThe start index.
bufferTMPEffectTagTuple[]Buffer to save the removed tags into. Leave at default if you do not want to get the tags.
bufferIndexintThe 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
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
tagTMPEffectTagThe tag to add.
startIndexintThe tag's start index.
endIndexintThe tag's end index.
orderAtIndexint?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
tagTMPEffectTagThe tag to add.
indicesTMPEffectTagIndicesThe 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