BookmarkCollection Class
Represents a collection of Bookmarks.
public sealed class BookmarkCollection : IList<Bookmark>, ICollection<Bookmark>, IEnumerable<Bookmark>, IEnumerable
Public NotInheritable Class BookmarkCollection
Implements IList(Of Bookmark), ICollection(Of Bookmark), IEnumerable(Of Bookmark), IEnumerable
- Inheritance:
- System.ObjectBookmarkCollection
Implements
Remarks
BookmarkCollection is used in a Bookmarks property.
Bookmarks collection contains all bookmarks in the document. Use Bookmarks collection to retrieve a Bookmark with a specified name, iterate over all bookmarks or remove a bookmark.
Bookmarks are usually used in a conjunction with Hyperlinks or Fields for navigating to a bookmarked part of the document or to render a page number (or some other information) of a bookmarked part of the document. For more information, see Bookmarks and Hyperlinks example.
Properties
Count
Gets the number of Bookmarks contained in the BookmarkCollection.
Property Value
- System.Int32
The number of Bookmarks contained in the BookmarkCollection.
Item[Int32]
Gets the Bookmark at the specified index.
[ComVisible(false)]
public Bookmark this[int index] { get; }
<ComVisible(False)>
Public ReadOnly Property Item(index As Integer) As Bookmark
Parameters
index
- System.Int32
The zero-based index of the Bookmark to get.
Property Value
Item[String]
Gets the Bookmark with the specified name.
[ComVisible(true)]
public Bookmark this[string name] { get; }
<ComVisible(True)>
Public ReadOnly Property Item(name As String) As Bookmark
Parameters
name
- System.String
The name of the bookmark to get.
Property Value
Methods
Clear()
Removes all elements from the BookmarkCollection.
Contains(Bookmark)
Determines whether an element is in the BookmarkCollection.
Parameters
item
- Bookmark
The element to locate in the BookmarkCollection.
Returns
- System.Boolean
true
if item is found in the BookmarkCollection; otherwise, false
.
CopyTo(Bookmark[], Int32)
Copies the entire BookmarkCollection to a compatible one-dimensional array, starting at the specified index of the target array.
public void CopyTo(Bookmark[] array, int arrayIndex)
Public Sub CopyTo(array As Bookmark(), arrayIndex As Integer)
Parameters
array
- Bookmark[]
The one-dimensional array that is the destination of the elements copied from BookmarkCollection.
arrayIndex
- System.Int32
The zero-based index in array at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through the BookmarkCollection.
public IEnumerator<Bookmark> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of Bookmark)
Returns
- System.Collections.Generic.IEnumerator<Bookmark>
An enumerator for the BookmarkCollection.
IndexOf(Bookmark)
Searches for the specified element and returns the zero-based index of the first occurrence within the entire BookmarkCollection.
Parameters
item
- Bookmark
The element to locate in the BookmarkCollection.
Returns
- System.Int32
The zero-based index of the first occurrence of item within the entire BookmarkCollection, if found; otherwise, -1.
Remove(Bookmark)
Removes the first occurrence of a specific element from the BookmarkCollection.
Parameters
item
- Bookmark
The element from the BookmarkCollection.
Returns
- System.Boolean
true
if item is successfully removed; otherwise, false
. This method also returns false
if item was not found in the BookmarkCollection.
RemoveAt(Int32)
Removes the element at the specified index of the BookmarkCollection.
Parameters
index
- System.Int32
The zero-based index of the element to remove.