Timeline​Marker​Collection Timeline​Marker​Collection Timeline​Marker​Collection Class

Definition

Represents a collection of TimelineMarker objects that can be individually accessed by index. A TimelineMarkerCollection is an ordered list where the order is determined by the Time value of each TimelineMarker item contained in the collection. For more info on how this affects the collection API, see Remarks.

public : sealed class TimelineMarkerCollection : IIterable, IVectorpublic sealed class TimelineMarkerCollection : IEnumerable, IListPublic NotInheritable Class TimelineMarkerCollection Implements IEnumerable, IList
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Collection API for TimelineMarkerCollection

A TimelineMarkerCollection is an ordered list where the order is determined by the Time value of each TimelineMarker item contained in the collection. The collection API for TimelineMarkerCollection internally processes each new item that is added to the collection and adds it at an index location that corresponds to an updated ordering of all Time values for all TimelineMarker items in the collection.

The intention of having the TimelineMarkerCollection always maintain a Time -based order is so that enumerating/iterating the collection gives the TimelineMarker values in the order that corresponds to the Position of a media asset that's being played and the order that MarkerReached events would fire. Otherwise, if the collection weren't Time -ordered, it would have been necessary to sort the collection by time prior to use.

  • If you call Add (or Append for C++), the item might be added to the beginning, middle or end of the ordered list, depending on the Time value of the TimelineMarker you are adding.
  • If you call Insert (or InsertAt for C++) the index parameter is ignored. The TimelineMarker item is added at an index position that maintains the collection's order by Time values. Basically Insert will act identically to Add.
  • If you use the Item indexer (or GetAt for C++) to read a value, the index is correct, based on how the item was added by the internal logic. But since you didn't directly control that logic, it's usually a better idea to use Contains (IndexOf for C++) to find a specific TimelineMarker in the ordered list.
  • If you use the Item indexer (or SetAt for C++) to set a value, you will delete a value that was previously at that index, but the collection will reorder itself to maintain the Time value ordering, so the new TimelineMarker you added might not be at the index you were setting to. This is probably a bad idea, because you won't be sure which item gets deleted. We recommend you don't use the indexer to set values.
  • RemoveAt will remove the specified indexed item, but won't remove possible duplicate items when the collection index shifts for the remaining Time values. We recommend you don't use RemoveAt.

Enumerating the collection in C# or Microsoft Visual Basic

A TimelineMarkerCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<TimelineMarker> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a TimelineMarker constraint.

Constructors

TimelineMarkerCollection() TimelineMarkerCollection() TimelineMarkerCollection()

Initializes a new instance of the TimelineMarkerCollection class.

public : TimelineMarkerCollection()public TimelineMarkerCollection()Public Sub New()
Attributes

Properties

Item[Int32] Item[Int32] Item[Int32]

Gets or sets the element at the specified index.

This member is not implemented in C++T this[int index] { get; set; }Property Item(index As Integer) As T
Parameters
index

The zero-based index of the element to get or set.

Value
T T T

The element at the specified index.

Attributes
Exceptions

index is not a valid index in the System.Collections.Generic.IList`1.

The property is set and the System.Collections.Generic.IList`1 is read-only.

Size Size Size

Gets the size (count) of the collection.

public : unsigned short Size { get; }This member is not implemented in C#This member is not implemented in VB.Net
Value
unsigned short uint uint

The count of items in the collection.

Attributes

Methods

Append(TimelineMarker) Append(TimelineMarker) Append(TimelineMarker)

Adds a new item to the collection.

public : void Append(TimelineMarker value)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
value
TimelineMarker TimelineMarker TimelineMarker

The new item to add.

Attributes

Remarks

Collection API for TimelineMarkerCollection

A TimelineMarkerCollection is an ordered list where the order is determined by the Time value of each TimelineMarker item contained in the collection. The collection API for TimelineMarkerCollection internally processes each new item that is added to the collection and adds it at an index location that corresponds to an updated ordering of all Time values for all TimelineMarker items in the collection.

The intention of having the TimelineMarkerCollection always maintain a Time -based order is so that enumerating/iterating the collection gives the TimelineMarker values in the order that corresponds to the Position of a media asset that's being played and the order that MarkerReached events would fire. Otherwise, if the collection weren't Time -ordered, it would have been necessary to sort the collection by time prior to use.

If you call Append, the item might be added to the beginning, middle or end of the ordered list, depending on the Time value of the TimelineMarker you are adding. This is different from typical Append behavior that extends the index and always adds to the last index.

Time values aren't exclusive in a TimelineMarkerCollection, more than one TimelineMarker with a shared Time can be in a list and will be in appropriate Time -based order. However the relative order between items that share a Time is indeterminate within the collection and should be considered an implementation detail.

Clear() Clear() Clear()

Removes all items from the collection.

public : void Clear()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

First() First() First()

Returns an iterator for the items in the collection.

public : IIterator<TimelineMarker> First()This member is not implemented in C#This member is not implemented in VB.Net
Returns

The iterator. The iterator's current position is at the 0-index position, or at the collection end if the collection is empty.

Attributes

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the item located at the specified index.

public : TimelineMarker GetAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The integer index for the value to retrieve.

Returns

The TimelineMarker value at the specified index.

Attributes

GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)
Returns

An enumerator that can be used to iterate through the collection.

Attributes

GetMany(UInt32, TimelineMarker[]) GetMany(UInt32, TimelineMarker[]) GetMany(UInt32, TimelineMarker[])

Retrieves multiple elements in a single pass through the iterator.

public : unsigned short GetMany(unsigned int startIndex, TimelineMarker[] items)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
startIndex
unsigned int UInt32 UInt32

The index from which to start retrieval.

items
TimelineMarker[] TimelineMarker[] TimelineMarker[]

Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results should be retrieved.

Returns
unsigned short uint uint

The number of items retrieved.

Attributes

GetView() GetView() GetView()

Gets an immutable view into the collection.

public : IVectorView<TimelineMarker> GetView()This member is not implemented in C#This member is not implemented in VB.Net
Returns
IVectorView<TimelineMarker> IReadOnlyList<TimelineMarker> IReadOnlyList<TimelineMarker>

An object representing the immutable collection view.

Attributes

IndexOf(T) IndexOf(T) IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

This member is not implemented in C++int IndexOf(T item)Function IndexOf(item As T) As Integer
Parameters
item
T T T

The object to locate in the System.Collections.Generic.IList`1.

Returns

The index of item if found in the list; otherwise, -1.

Attributes

IndexOf(TimelineMarker, UInt32) IndexOf(TimelineMarker, UInt32) IndexOf(TimelineMarker, UInt32)

Retrieves the index of the specified item.

public : PlatForm::Boolean IndexOf(TimelineMarker value, unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
value
TimelineMarker TimelineMarker TimelineMarker

The value to find in the collection.

index
unsigned int UInt32 UInt32

The index of the item to find, if found.

Returns
PlatForm::Boolean bool bool

true if an item with the specified value was found; otherwise, false.

Attributes

Insert(Int32, T) Insert(Int32, T) Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

This member is not implemented in C++void Insert(int index, T item)Sub Insert(index As Integer, item As T)
Parameters
index

The zero-based index at which item should be inserted.

item
T T T

The object to insert into the System.Collections.Generic.IList`1.

Attributes
Exceptions

index is not a valid index in the System.Collections.Generic.IList`1.

The System.Collections.Generic.IList`1 is read-only.

InsertAt(UInt32, TimelineMarker) InsertAt(UInt32, TimelineMarker) InsertAt(UInt32, TimelineMarker)

Inserts the specified item.

public : void InsertAt(unsigned int index, TimelineMarker value)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The index at which to set the value.

value
TimelineMarker TimelineMarker TimelineMarker

The value to set.

Attributes

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

This member is not implemented in C++void RemoveAt(int index)Sub RemoveAt(index As Integer)
Parameters
index

The zero-based index of the item to remove.

Attributes
Exceptions

index is not a valid index in the System.Collections.Generic.IList`1.

The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)

Removes the item at the specified index.

public : void RemoveAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The index position of the item to remove.

Attributes

Remarks

Collection API for TimelineMarkerCollection

A TimelineMarkerCollection is an ordered list where the order is determined by the Time value of each TimelineMarker item contained in the collection. The collection API for TimelineMarkerCollection internally processes each new item that is added to the collection and adds it at an index location that corresponds to an updated ordering of all Time values for all TimelineMarker items in the collection.

RemoveAt will remove the specified indexed item, but won't remove possible duplicate items when the collection index shifts for the remaining Time values. We recommend you don't use RemoveAt.

RemoveAtEnd() RemoveAtEnd() RemoveAtEnd()

Removes the last item in the collection.

public : void RemoveAtEnd()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

ReplaceAll(TimelineMarker[]) ReplaceAll(TimelineMarker[]) ReplaceAll(TimelineMarker[])

Initially clears the collection, then inserts the provided array as new items.

public : void ReplaceAll(TimelineMarker[] items)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
items
TimelineMarker[] TimelineMarker[] TimelineMarker[]

The new collection items.

Attributes

SetAt(UInt32, TimelineMarker) SetAt(UInt32, TimelineMarker) SetAt(UInt32, TimelineMarker)

Sets the value at the specified index to the TimelineMarker value specified.

public : void SetAt(unsigned int index, TimelineMarker value)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The index at which to set the value.

value
TimelineMarker TimelineMarker TimelineMarker

The value to set.

Attributes

Remarks

Collection API for TimelineMarkerCollection

A TimelineMarkerCollection is an ordered list where the order is determined by the Time value of each TimelineMarker item contained in the collection. The collection API for TimelineMarkerCollection internally processes each new item that is added to the collection and adds it at an index location that corresponds to an updated ordering of all Time values for all TimelineMarker items in the collection.

We recommend you don't use SetAt to set (change) values because the integer index position is controlled by the internal logic. Instead, iterate the collection and delete items with specific Time values or that match a complete TimelineMarker set of values.

See Also