CommentCollection Class
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:
- CommentCollection
Properties
Count
Gets the number of Comments contained in the collection.
Property Value
Item[Int32]
Gets or sets the Comment at the specified index.
public Comment this[int index] { get; set; }
Public Property Item(index As Integer) As Comment
Parameters
Property Value
Exceptions
index
is less than zero or index
is equal to or greater than Count.
value
is null.
Methods
Add(Comment)
Adds a Comment to the end of the collection.
Parameters
Exceptions
item
is null.
Add(CommentAuthor, String)
Adds a new comment with the specified author in the top-left corner of the slide.
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
- String
The comment text.
Returns
A newly added comment positioned in the top-left corner of the slide.
Exceptions
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.
Parameters
text
- String
The comment text.
Returns
A newly added comment positioned in the top-left corner of the slide.
Exceptions
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.
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
- String
Name of the new author.
authorInitials
- String
The initials of the new author or null if initials should be resolved from authorName
.
text
- String
The comment text.
Returns
A newly added comment positioned in the top-left corner of the slide.
Exceptions
authorName
or resolved authorInitials
is null or Empty.
text
is null.
Clear()
Removes all Comments from the collection.
Contains(Comment)
Determines whether a Comment is in the collection.
Parameters
Returns
true if item
is found in the collection; otherwise, false.
Exceptions
item
is null.
GetEnumerator()
Returns an enumerator that iterates through the CommentCollection.
public IEnumerator<Comment> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of Comment)
Returns
An 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.
Parameters
Returns
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.
public void Insert(int index, Comment item)
Public Sub Insert(index As Integer, item As Comment)
Parameters
Exceptions
index
is less than zero or index
is equal to or greater than Count.
item
is null.
Remove(Comment)
Removes the first occurrence of a specific Comment from the collection.
Parameters
Returns
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.
Parameters
Exceptions
index
is less than zero or index
is equal to or greater than Count.