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:
- System.ObjectCommentCollection
Implements
Properties
Count
Gets the number of Comments contained in the collection.
Property Value
- System.Int32
The number of Comments contained in the collection.
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
index
- System.Int32
The zero-based index of the Comment to get or set.
Property Value
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.
Parameters
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.
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
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.
Parameters
text
- System.String
The comment text.
Returns
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.
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
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.
Contains(Comment)
Determines whether a Comment is in the collection.
Parameters
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.
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.
Parameters
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.
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.
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.
Parameters
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.
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.