Class CommentCollection
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Mengenkapsulasi koleksi objek Aspose.Cells.Comment.
public class CommentCollection : CollectionBase<comment>, IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Pewarisan
object ← CollectionBase<comment> ← CommentCollection
Mengimplementasikan
IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
Anggota yang Dwarisi
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()
Contoh
Workbook workbook = new Workbook();
CommentCollection comments = workbook.Worksheets[0].Comments;
//lakukan pekerjaan Anda
Dim workbook as Workbook = new Workbook()
Dim comments as CommentCollection = workbook.Worksheets(0).Comments
Properti
this[int]
Mengambil elemen Aspose.Cells.Comment pada indeks yang ditentukan.
public Comment this[int index] { get; }
Nilai Properti
Contoh
Comment comment3 = comments[0];
comment3.Note = "Tiga catatan.";
this[string]
Mengambil elemen Aspose.Cells.Comment pada sel yang ditentukan.
public Comment this[string cellName] { get; }
Nilai Properti
Contoh
Comment comment4 = comments["B2"];
comment4.Note = "Empat catatan.";
this[int, int]
Mengambil elemen Aspose.Cells.Comment pada indeks baris dan indeks kolom yang ditentukan.
public Comment this[int row, int column] { get; }
Nilai Properti
Contoh
Comment comment5 = comments[1,1];
comment5.Note = "Lima catatan.";
Metode
Add(int, int)
Menambahkan komentar ke koleksi.
public int Add(int row, int column)
Parameter
row
int
Indeks baris sel.
column
int
Indeks kolom sel.
Mengembalikan
Indeks objek Aspose.Cells.Comment.
Contoh
int commentIndex1 = comments.Add(0, 0);
Comment comment1 = comments[commentIndex1];
comment1.Note = "Catatan pertama.";
comment1.Font.Name = "Times New Roman";
Add(string)
Menambahkan komentar ke koleksi.
public int Add(string cellName)
Parameter
cellName
string
Nama sel.
Mengembalikan
Indeks objek Aspose.Cells.Comment.
Contoh
int commentIndex2 = comments.Add("B2");
Comment comment2 = comments[commentIndex2];
comment2.Note = "Catatan kedua.";
comment2.Font.Name = "Times New Roman";
AddThreadedComment(int, int, string, ThreadedCommentAuthor)
Menambahkan komentar terhubung.
public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)
Parameter
row
int
Indeks baris sel.
column
int
Indeks kolom sel.
text
string
Teks dari komentar
author
ThreadedCommentAuthor
Pengguna komentar terhubung ini.
Mengembalikan
Indeks objek Aspose.Cells.ThreadedComment.
AddThreadedComment(string, string, ThreadedCommentAuthor)
Menambahkan komentar terhubung.
public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)
Parameter
cellName
string
Nama sel.
text
string
Teks dari komentar
author
ThreadedCommentAuthor
Pengguna komentar terhubung ini.
Mengembalikan
Indeks objek Aspose.Cells.ThreadedComment.
Clear()
Menghapus semua komentar;
public void Clear()
Contoh
comments.Clear();
GetThreadedComments(int, int)
Mengambil komentar terhubung berdasarkan indeks baris dan kolom.
public ThreadedCommentCollection GetThreadedComments(int row, int column)
Parameter
row
int
Indeks baris.
column
int
Indeks kolom.
Mengembalikan
Contoh
ThreadedCommentCollection threadedComments1 = comments.GetThreadedComments(1, 1);
for (int i = 0; i < threadedComments1.Count; ++i)
{
ThreadedComment tc = threadedComments1[i];
string note = tc.Notes;
}
GetThreadedComments(string)
Mengambil komentar terhubung berdasarkan nama sel.
public ThreadedCommentCollection GetThreadedComments(string cellName)
Parameter
cellName
string
Nama sel.
Mengembalikan
Contoh
ThreadedCommentCollection threadedComments2 = comments.GetThreadedComments("B2");
for (int i = 0; i < threadedComments2.Count; ++i)
{
ThreadedComment tc = threadedComments2[i];
string note = tc.Notes;
}
RemoveAt(string)
Menghapus komentar dari sel tertentu.
public void RemoveAt(string cellName)
Parameter
cellName
string
Nama sel yang berisi komentar.
Contoh
comments.RemoveAt("B2");
RemoveAt(int, int)
Menghapus komentar dari sel tertentu.
public void RemoveAt(int row, int column)
Parameter
row
int
Indeks baris.
column
int
indeks kolom.
Contoh
comments.RemoveAt(1,1);