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

    Show / Hide Table of Contents

    CommentCollection Class

    Namespace:
    GemBox.Presentation
    Assembly:
    GemBox.Presentation.dll

    Represents a collection of Comments that are contained on a particular Slide.

    • C#
    • VB.NET
    public sealed class CommentCollection : Collection<Comment>, IList, ICollection, IList<Comment>, ICollection<Comment>, IEnumerable<Comment>, IEnumerable
    Public NotInheritable Class CommentCollection
        Inherits Collection(Of Comment)
        Implements IList, ICollection, IList(Of Comment), ICollection(Of Comment), IEnumerable(Of Comment), IEnumerable
    Inheritance:
    System.Object
    Collection
    Collection<Comment>
    CommentCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<Comment>
    System.Collections.Generic.ICollection<Comment>
    System.Collections.Generic.IEnumerable<Comment>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of Comments contained in the collection.

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

    The number of Comments contained in the collection.

    Item[Int32]

    Gets or sets the Comment at the specified index.

    • C#
    • VB.NET
    public Comment this[int index] { get; set; }
    Public Property Item(index As Integer) As Comment
    Parameters
    index
    System.Int32

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

    Property Value
    Comment

    The Comment at the specified index.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    System.ArgumentNullException

    value is null.

    Methods

    Add(Comment)

    Adds a Comment to the end of the collection.

    • C#
    • VB.NET
    public void Add(Comment item)
    Public Sub Add(item As Comment)
    Parameters
    item
    Comment

    The Comment to be added to the end of the collection.

    Exceptions
    System.ArgumentNullException

    item is null.

    Add(CommentAuthor, String)

    Adds a new comment with the specified author in the top-left corner of the slide.

    • C#
    • VB.NET
    public Comment Add(CommentAuthor author, string text)
    Public Function Add(author As CommentAuthor, text As String) As Comment
    Parameters
    author
    CommentAuthor

    The comment author.

    text
    System.String

    The comment text.

    Returns
    Comment

    A newly added comment positioned in the top-left corner of the slide.

    Exceptions
    System.ArgumentNullException

    author or text is null.

    Add(String)

    Adds a new comment with the same author as the previously added comment in the top-left corner of the slide.

    • C#
    • VB.NET
    public Comment Add(string text)
    Public Function Add(text As String) As Comment
    Parameters
    text
    System.String

    The comment text.

    Returns
    Comment

    A newly added comment positioned in the top-left corner of the slide.

    Exceptions
    System.InvalidOperationException

    No comment with the specified author was previously added. Use another overload that specifies the author.

    Add(String, String, String)

    Adds a new comment with a new author in the top-left corner of the slide.

    • C#
    • VB.NET
    public Comment Add(string authorName, string authorInitials, string text)
    Public Function Add(authorName As String, authorInitials As String, text As String) As Comment
    Parameters
    authorName
    System.String

    Name of the new author.

    authorInitials
    System.String

    The initials of the new author or null if initials should be resolved from authorName.

    text
    System.String

    The comment text.

    Returns
    Comment

    A newly added comment positioned in the top-left corner of the slide.

    Exceptions
    System.ArgumentException

    authorName or resolved authorInitials is null or System.String.Empty.

    System.ArgumentNullException

    text is null.

    Clear()

    Removes all Comments from the collection.

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

    Contains(Comment)

    Determines whether a Comment is in the collection.

    • C#
    • VB.NET
    public bool Contains(Comment item)
    Public Function Contains(item As Comment) As Boolean
    Parameters
    item
    Comment

    The Comment to locate in the collection.

    Returns
    System.Boolean

    true if item is found in the collection; otherwise, false.

    Exceptions
    System.ArgumentNullException

    item is null.

    GetEnumerator()

    Returns an enumerator that iterates through the CommentCollection.

    • C#
    • VB.NET
    public IEnumerator<Comment> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of Comment)
    Returns
    System.Collections.Generic.IEnumerator<Comment>

    An System.Collections.Generic.IEnumerator<T> for the collection.

    IndexOf(Comment)

    Searches for the specified Comment and returns the zero-based index of the first occurrence within the entire collection.

    • C#
    • VB.NET
    public int IndexOf(Comment item)
    Public Function IndexOf(item As Comment) As Integer
    Parameters
    item
    Comment

    The Comment 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.

    Insert(Int32, Comment)

    Inserts a Comment to the collection at the specified index.

    • C#
    • VB.NET
    public void Insert(int index, Comment item)
    Public Sub Insert(index As Integer, item As Comment)
    Parameters
    index
    System.Int32

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

    item
    Comment

    The Comment to insert into the collection.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    System.ArgumentNullException

    item is null.

    Remove(Comment)

    Removes the first occurrence of a specific Comment from the collection.

    • C#
    • VB.NET
    public bool Remove(Comment item)
    Public Function Remove(item As Comment) As Boolean
    Parameters
    item
    Comment

    The Comment 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.

    RemoveAt(Int32)

    Removes the Comment at the specified index of the collection.

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

    The zero-based index of the Comment to remove.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    Implements

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

    Examples

    Comments Example

    See Also

    Comments
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.