GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    BookmarkCollection Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a collection of Bookmarks.

    • C#
    • VB.NET
    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.Object
    BookmarkCollection
    Implements
    System.Collections.Generic.IList<Bookmark>
    System.Collections.Generic.ICollection<Bookmark>
    System.Collections.Generic.IEnumerable<Bookmark>
    System.Collections.IEnumerable
    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.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of Bookmarks contained in the BookmarkCollection.

    Item[Int32]

    Gets the Bookmark at the specified index.

    • C#
    • VB.NET
    [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
    Bookmark

    The Bookmark at the specified index.

    Item[String]

    Gets the Bookmark with the specified name.

    • C#
    • VB.NET
    [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
    Bookmark

    The Bookmark with the specified name.

    Methods

    Clear()

    Removes all elements from the BookmarkCollection.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Contains(Bookmark)

    Determines whether an element is in the BookmarkCollection.

    • C#
    • VB.NET
    public bool Contains(Bookmark item)
    Public Function Contains(item As Bookmark) As Boolean
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public int IndexOf(Bookmark item)
    Public Function IndexOf(item As Bookmark) As Integer
    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.

    • C#
    • VB.NET
    public bool Remove(Bookmark item)
    Public Function Remove(item As Bookmark) As Boolean
    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.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the element to remove.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    Bookmarks
    Bookmark
    BookmarkStart
    BookmarkEnd
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.