Class CommentCollection
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Enkapsuluje kolekcję obiektów Aspose.Cells.Comment.
public class CommentCollection : CollectionBase<comment>, IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Dziedziczenie
object ← CollectionBase<comment> ← CommentCollection
Implementuje
IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Członkowie dziedziczeni
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()
Przykłady
Workbook workbook = new Workbook();
CommentCollection comments = workbook.Worksheets[0].Comments;
//wykonaj swoje operacje
Dim workbook as Workbook = new Workbook()
Dim comments as CommentCollection = workbook.Worksheets(0).Comments
Właściwości
this[int]
Pobiera element Aspose.Cells.Comment o określonym indeksie.
public Comment this[int index] { get; }
Wartość właściwości
Przykłady
Comment comment3 = comments[0];
comment3.Note = "Trzy notatka.";
this[string]
Pobiera element Aspose.Cells.Comment w określonej komórce.
public Comment this[string cellName] { get; }
Wartość właściwości
Przykłady
Comment comment4 = comments["B2"];
comment4.Note = "Cztery notatka.";
this[int, int]
Pobiera element Aspose.Cells.Comment o określonym indeksie wiersza i indeksie kolumny.
public Comment this[int row, int column] { get; }
Wartość właściwości
Przykłady
Comment comment5 = comments[1,1];
comment5.Note = "Pięć notatka.";
Metody
Add(int, int)
Dodaje komentarz do kolekcji.
public int Add(int row, int column)
Parametry
row
int
Indeks wiersza komórki.
column
int
Indeks kolumny komórki.
Zwraca
Indeks obiektu Aspose.Cells.Comment.
Przykłady
int commentIndex1 = comments.Add(0, 0);
Comment comment1 = comments[commentIndex1];
comment1.Note = "Pierwsza notatka.";
comment1.Font.Name = "Times New Roman";
Add(string)
Dodaje komentarz do kolekcji.
public int Add(string cellName)
Parametry
cellName
string
Nazwa komórki.
Zwraca
Indeks obiektu Aspose.Cells.Comment.
Przykłady
int commentIndex2 = comments.Add("B2");
Comment comment2 = comments[commentIndex2];
comment2.Note = "Druga notatka.";
comment2.Font.Name = "Times New Roman";
AddThreadedComment(int, int, string, ThreadedCommentAuthor)
Dodaje wątkowany komentarz.
public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)
Parametry
row
int
Indeks wiersza komórki.
column
int
Indeks kolumny komórki.
text
string
Tekst komentarza
author
ThreadedCommentAuthor
Użytkownik tego wątkowanego komentarza.
Zwraca
Indeks obiektu Aspose.Cells.ThreadedComment.
AddThreadedComment(string, string, ThreadedCommentAuthor)
Dodaje wątkowany komentarz.
public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)
Parametry
cellName
string
Nazwa komórki.
text
string
Tekst komentarza
author
ThreadedCommentAuthor
Użytkownik tego wątkowanego komentarza.
Zwraca
Indeks obiektu Aspose.Cells.ThreadedComment.
Clear()
Usuwa wszystkie komentarze;
public void Clear()
Przykłady
comments.Clear();
GetThreadedComments(int, int)
Pobiera wątkowane komentarze według indeksu wiersza i kolumny.
public ThreadedCommentCollection GetThreadedComments(int row, int column)
Parametry
row
int
Indeks wiersza.
column
int
Indeks kolumny.
Zwraca
Przykłady
ThreadedCommentCollection threadedComments1 = comments.GetThreadedComments(1, 1);
for (int i = 0; i < threadedComments1.Count; ++i)
{
ThreadedComment tc = threadedComments1[i];
string note = tc.Notes;
}
GetThreadedComments(string)
Pobiera wątkowane komentarze według nazwy komórki.
public ThreadedCommentCollection GetThreadedComments(string cellName)
Parametry
cellName
string
Nazwa komórki.
Zwraca
Przykłady
ThreadedCommentCollection threadedComments2 = comments.GetThreadedComments("B2");
for (int i = 0; i < threadedComments2.Count; ++i)
{
ThreadedComment tc = threadedComments2[i];
string note = tc.Notes;
}
RemoveAt(string)
Usuwa komentarz z konkretnej komórki.
public void RemoveAt(string cellName)
Parametry
cellName
string
Nazwa komórki, która zawiera komentarz.
Przykłady
comments.RemoveAt("B2");
RemoveAt(int, int)
Usuwa komentarz z konkretnej komórki.
public void RemoveAt(int row, int column)
Parametry
row
int
Indeks wiersza.
column
int
indeks kolumny.
Przykłady
comments.RemoveAt(1,1);