CommentCollection Class
Represents a collection of Comments.
public sealed class CommentCollection : ElementCollection, IList, ICollection, IList<Comment>, ICollection<Comment>, IEnumerable<Comment>, IEnumerable
Public NotInheritable Class CommentCollection
Inherits ElementCollection
Implements IList, ICollection, IList(Of Comment), ICollection(Of Comment), IEnumerable(Of Comment), IEnumerable
- Inheritance:
- System.ObjectCommentCollection
Implements
Remarks
CommentCollection is used in a Comments property.
Comments collection contains all bookmarks in the document. Use Comments collection to retrieve a Comment, iterate over all comments or remove a comment.
Properties
Item[Int32]
Gets the Comment at the specified index.
[ComVisible(false)]
public Comment this[int index] { get; }
<ComVisible(False)>
Public ReadOnly Property Item(index As Integer) As Comment
Parameters
index
- System.Int32
The zero-based index of the Comment to get.
Property Value
Methods
Contains(Comment)
Determines whether an element is in the CommentCollection.
Parameters
item
- Comment
The element to locate in the CommentCollection.
Returns
- System.Boolean
true
if item is found in the CommentCollection; otherwise, false
.
CopyTo(Comment[], Int32)
Copies the entire CommentCollection to a compatible one-dimensional array, starting at the specified index of the target array.
public void CopyTo(Comment[] array, int arrayIndex)
Public Sub CopyTo(array As Comment(), arrayIndex As Integer)
Parameters
array
- Comment[]
The one-dimensional array that is the destination of the elements copied from CommentCollection.
arrayIndex
- System.Int32
The zero-based index in array at which copying begins.
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 enumerator for the CommentCollection.
IndexOf(Comment)
Searches for the specified element and returns the zero-based index of the first occurrence within the entire CommentCollection.
Parameters
item
- Comment
The element to locate in the CommentCollection.
Returns
- System.Int32
The zero-based index of the first occurrence of item within the entire CommentCollection, if found; otherwise, -1.
Remove(Comment)
Removes the first occurrence of a specific element from the CommentCollection.
Parameters
item
- Comment
The element from the CommentCollection.
Returns
- System.Boolean
true
if item is successfully removed; otherwise, false
. This method also returns false
if item was not found in the CommentCollection.
Inherited Properties
Content | Gets the content of the current ElementCollection. (Inherited from ElementCollection) |
Count | Gets the number of elements contained in the ElementCollection. (Inherited from ElementCollection) |
SupportedElementTypes | Gets a sequence of ElementTypes that can be contained in this collection. (Inherited from ElementCollection) |
Inherited Methods
Clear() | Removes all elements from the ElementCollection. (Inherited from ElementCollection) |
CopyTo(Element[], System.Int32) | Copies the elements of the ElementCollection to an System.Array, starting at a particular System.Array index. (Inherited from ElementCollection) |
IndexOf(Element) | Determines the index of a specific Element in the ElementCollection. (Inherited from ElementCollection) |
RemoveAt(System.Int32) | Removes the element at the specified index of the ElementCollection. (Inherited from ElementCollection) |