MediaBookmarkCollection Class
Represents a collection of bookmarks in the media.
public sealed class MediaBookmarkCollection : Collection<MediaBookmark>, IList, ICollection, IList<MediaBookmark>, ICollection<MediaBookmark>, IEnumerable<MediaBookmark>, IEnumerable
Public NotInheritable Class MediaBookmarkCollection
Inherits Collection(Of MediaBookmark)
Implements IList, ICollection, IList(Of MediaBookmark), ICollection(Of MediaBookmark), IEnumerable(Of MediaBookmark), IEnumerable
- Inheritance:
- System.ObjectMediaBookmarkCollection
Implements
Remarks
All bookmarks in this collection must have unique names and time offsets. Collection is sorted based on bookmark's time offsets.
Properties
Count
Gets the number of MediaBookmarks contained in the collection.
Property Value
- System.Int32
The number of MediaBookmarks contained in the collection.
Item[TimeOffset]
Gets the bookmark name at the specified time offset.
Returns null if there is no bookmark at the specified time offset.
public string this[TimeOffset time] { get; }
Public ReadOnly Property Item(time As TimeOffset) As String
Parameters
time
- TimeOffset
The time offset.
Property Value
- System.String
The bookmark name at the specified time offset.
Item[Int32]
Gets the MediaBookmark at the specified index.
public MediaBookmark this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As MediaBookmark
Parameters
index
- System.Int32
The zero-based index of the MediaBookmark to get or set.
Property Value
The MediaBookmark at the specified index.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
Methods
Add(TimeOffset)
Adds a new implicitly named bookmark or gets the existing bookmark at the specified time offset.
public MediaBookmark Add(TimeOffset time)
Public Function Add(time As TimeOffset) As MediaBookmark
Parameters
time
- TimeOffset
The time offset.
Returns
A newly added implicitly named bookmark or the existing bookmark at the specified time offset.
Add(String, TimeOffset)
Adds a new bookmark or gets the existing equally named bookmark at the specified time offset.
public MediaBookmark Add(string name, TimeOffset time)
Public Function Add(name As String, time As TimeOffset) As MediaBookmark
Parameters
name
- System.String
The bookmark name.
time
- TimeOffset
The time offset.
Returns
Exceptions
- System.ArgumentException
Bookmark with the different name already exist at the specified time offset. or Bookmark with the same name already exist at the different time offset.
Clear()
Removes all MediaBookmarks from the collection.
Contains(MediaBookmark)
Determines whether a MediaBookmark is in the collection.
public bool Contains(MediaBookmark item)
Public Function Contains(item As MediaBookmark) As Boolean
Parameters
item
- MediaBookmark
The MediaBookmark to locate in the collection.
Returns
- System.Boolean
true if item
is found in the collection; otherwise, false.
Exceptions
- System.ArgumentNullException
item
is null.
Contains(String)
Determines whether a bookmark with the specified name is contained in the media bookmarks.
Parameters
name
- System.String
The bookmark name.
Returns
- System.Boolean
true if bookmark with the specified name is found in the media bookmarks; otherwise, false.
GetEnumerator()
Returns an enumerator that iterates through the MediaBookmarkCollection.
public IEnumerator<MediaBookmark> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of MediaBookmark)
Returns
- System.Collections.Generic.IEnumerator<MediaBookmark>
An System.Collections.Generic.IEnumerator<T> for the collection.
IndexOf(MediaBookmark)
Searches for the specified MediaBookmark and returns the zero-based index of the first occurrence within the entire collection.
public int IndexOf(MediaBookmark item)
Public Function IndexOf(item As MediaBookmark) As Integer
Parameters
item
- MediaBookmark
The MediaBookmark to locate in the collection.
Returns
- System.Int32
The zero-based index of the first occurrence of item
within the entire collection, if found; otherwise, -1.
Remove(MediaBookmark)
Removes the first occurrence of a specific MediaBookmark from the collection.
public bool Remove(MediaBookmark item)
Public Function Remove(item As MediaBookmark) As Boolean
Parameters
item
- MediaBookmark
The MediaBookmark to remove from the collection.
Returns
- System.Boolean
true if item
is successfully removed; otherwise, false. This method also returns false if item
was not found in the original collection.
Remove(TimeOffset)
Removes a MediaBookmark with the specified time offset from the collection.
Parameters
time
- TimeOffset
The time offset of the MediaBookmark to remove from the collection.
Returns
- System.Boolean
true if MediaBookmark with the specified time offset is successfully removed; otherwise, false. This method also returns false if MediaBookmark with the specified time offset was not found in the original collection.
Remove(String)
Removes a MediaBookmark with the specified name from the collection.
Parameters
name
- System.String
The name of the MediaBookmark to remove from the collection.
Returns
- System.Boolean
true if MediaBookmark with the specified name is successfully removed; otherwise, false. This method also returns false if MediaBookmark with the specified name was not found in the original collection.
RemoveAt(Int32)
Removes the MediaBookmark at the specified index of the collection.
Parameters
index
- System.Int32
The zero-based index of the MediaBookmark to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.