Class CommentCollection
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Encapsule une collection d’objets Aspose.Cells.Comment.
public class CommentCollection : CollectionBase<comment>, IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Héritage
object ← CollectionBase<comment> ← CommentCollection
Implémente
IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Membres hérités
CollectionBase<comment>.BinarySearch(Comment), CollectionBase<comment>.BinarySearch(Comment, IComparer<comment>), CollectionBase<comment>.BinarySearch(int, int, Comment, IComparer<comment>), CollectionBase<comment>.Contains(Comment), CollectionBase<comment>.CopyTo(Comment[]), CollectionBase<comment>.CopyTo(Comment[], int), CollectionBase<comment>.CopyTo(int, Comment[], int, int), CollectionBase<comment>.Exists(Predicate<comment>), CollectionBase<comment>.Find(Predicate<comment>), CollectionBase<comment>.FindAll(Predicate<comment>), CollectionBase<comment>.FindIndex(Predicate<comment>), CollectionBase<comment>.FindIndex(int, Predicate<comment>), CollectionBase<comment>.FindIndex(int, int, Predicate<comment>), CollectionBase<comment>.FindLast(Predicate<comment>), CollectionBase<comment>.FindLastIndex(Predicate<comment>), CollectionBase<comment>.FindLastIndex(int, Predicate<comment>), CollectionBase<comment>.FindLastIndex(int, int, Predicate<comment>), CollectionBase<comment>.IndexOf(Comment), CollectionBase<comment>.IndexOf(Comment, int), CollectionBase<comment>.IndexOf(Comment, int, int), CollectionBase<comment>.LastIndexOf(Comment), CollectionBase<comment>.LastIndexOf(Comment, int), CollectionBase<comment>.LastIndexOf(Comment, int, int), CollectionBase<comment>.GetEnumerator(), CollectionBase<comment>.Clear(), CollectionBase<comment>.RemoveAt(int), CollectionBase<comment>.OnClearComplete(), CollectionBase<comment>.OnClear(), CollectionBase<comment>.Capacity, CollectionBase<comment>.Count, CollectionBase<comment>.InnerList, CollectionBase<comment>.this[int], object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Exemples
Workbook workbook = new Workbook();
CommentCollection comments = workbook.Worksheets[0].Comments;
//faites votre travail
Dim workbook as Workbook = new Workbook()
Dim comments as CommentCollection = workbook.Worksheets(0).Comments
Propriétés
this[int]
Obtient l’élément Aspose.Cells.Comment à l’index spécifié.
public Comment this[int index] { get; }
Valeur de propriété
Exemples
Comment comment3 = comments[0];
comment3.Note = "Trois note.";
this[string]
Obtient l’élément Aspose.Cells.Comment à la cellule spécifiée.
public Comment this[string cellName] { get; }
Valeur de propriété
Exemples
Comment comment4 = comments["B2"];
comment4.Note = "Quatre note.";
this[int, int]
Obtient l’élément Aspose.Cells.Comment à l’index de ligne et de colonne spécifié.
public Comment this[int row, int column] { get; }
Valeur de propriété
Exemples
Comment comment5 = comments[1,1];
comment5.Note = "Cinq note.";
Méthodes
Add(int, int)
Ajoute un commentaire à la collection.
public int Add(int row, int column)
Paramètres
row
int
Index de ligne de la cellule.
column
int
Index de colonne de la cellule.
Renvoie
Index de l’objet Aspose.Cells.Comment.
Exemples
int commentIndex1 = comments.Add(0, 0);
Comment comment1 = comments[commentIndex1];
comment1.Note = "Premier note.";
comment1.Font.Name = "Times New Roman";
Add(string)
Ajoute un commentaire à la collection.
public int Add(string cellName)
Paramètres
cellName
string
Nom de la cellule.
Renvoie
Index de l’objet Aspose.Cells.Comment.
Exemples
int commentIndex2 = comments.Add("B2");
Comment comment2 = comments[commentIndex2];
comment2.Note = "Deuxième note.";
comment2.Font.Name = "Times New Roman";
AddThreadedComment(int, int, string, ThreadedCommentAuthor)
Ajoute un commentaire en fil.
public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)
Paramètres
row
int
Index de ligne de la cellule.
column
int
Index de colonne de la cellule.
text
string
Le texte du commentaire.
author
ThreadedCommentAuthor
L’utilisateur de ce commentaire en fil.
Renvoie
Index de l’objet Aspose.Cells.ThreadedComment.
AddThreadedComment(string, string, ThreadedCommentAuthor)
Ajoute un commentaire en fil.
public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)
Paramètres
cellName
string
Le nom de la cellule.
text
string
Le texte du commentaire.
author
ThreadedCommentAuthor
L’utilisateur de ce commentaire en fil.
Renvoie
Index de l’objet Aspose.Cells.ThreadedComment.
Clear()
Supprime tous les commentaires ;
public void Clear()
Exemples
comments.Clear();
GetThreadedComments(int, int)
Obtient les commentaires en fil par index de ligne et de colonne.
public ThreadedCommentCollection GetThreadedComments(int row, int column)
Paramètres
row
int
L’index de ligne.
column
int
L’index de colonne.
Renvoie
Exemples
ThreadedCommentCollection threadedComments1 = comments.GetThreadedComments(1, 1);
for (int i = 0; i < threadedComments1.Count; ++i)
{
ThreadedComment tc = threadedComments1[i];
string note = tc.Notes;
}
GetThreadedComments(string)
Obtient les commentaires en fil par nom de cellule.
public ThreadedCommentCollection GetThreadedComments(string cellName)
Paramètres
cellName
string
Le nom de la cellule.
Renvoie
Exemples
ThreadedCommentCollection threadedComments2 = comments.GetThreadedComments("B2");
for (int i = 0; i < threadedComments2.Count; ++i)
{
ThreadedComment tc = threadedComments2[i];
string note = tc.Notes;
}
RemoveAt(string)
Supprime le commentaire de la cellule spécifique.
public void RemoveAt(string cellName)
Paramètres
cellName
string
Le nom de la cellule qui contient un commentaire.
Exemples
comments.RemoveAt("B2");
RemoveAt(int, int)
Supprime le commentaire de la cellule spécifique.
public void RemoveAt(int row, int column)
Paramètres
row
int
L’index de ligne.
column
int
L’index de colonne.
Exemples
comments.RemoveAt(1,1);