Class CommentCollection
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
รวมกลุ่มของวัตถุ Aspose.Cells.Comment
public class CommentCollection : CollectionBase<comment>, IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
การสืบทอด
object ← CollectionBase<comment> ← CommentCollection
การใช้งาน
IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable
สมาชิกที่สืบทอด
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()
ตัวอย่าง
Workbook workbook = new Workbook();
CommentCollection comments = workbook.Worksheets[0].Comments;
//ทำธุรกิจของคุณ
Dim workbook as Workbook = new Workbook()
Dim comments as CommentCollection = workbook.Worksheets(0).Comments
คุณสมบัติ
this[int]
รับองค์ประกอบ Aspose.Cells.Comment ที่ตำแหน่งดัชนีที่ระบุ
public Comment this[int index] { get; }
ค่า Property
ตัวอย่าง
Comment comment3 = comments[0];
comment3.Note = "หมายเหตุที่สาม.";
this[string]
รับองค์ประกอบ Aspose.Cells.Comment ที่เซลล์ที่ระบุ
public Comment this[string cellName] { get; }
ค่า Property
ตัวอย่าง
Comment comment4 = comments["B2"];
comment4.Note = "หมายเหตุที่สี่.";
this[int, int]
รับองค์ประกอบ Aspose.Cells.Comment ที่ดัชนีแถวและดัชนีคอลัมน์ที่ระบุ
public Comment this[int row, int column] { get; }
ค่า Property
ตัวอย่าง
Comment comment5 = comments[1,1];
comment5.Note = "หมายเหตุที่ห้า.";
วิธีการ
Add(int, int)
เพิ่มความคิดเห็นลงในคอลเลกชัน
public int Add(int row, int column)
พารามิเตอร์
row
int
ดัชนีแถวของเซลล์
column
int
ดัชนีคอลัมน์ของเซลล์
คืนค่า
ดัชนีของวัตถุ Aspose.Cells.Comment
ตัวอย่าง
int commentIndex1 = comments.Add(0, 0);
Comment comment1 = comments[commentIndex1];
comment1.Note = "หมายเหตุแรก.";
comment1.Font.Name = "Times New Roman";
Add(string)
เพิ่มความคิดเห็นลงในคอลเลกชัน
public int Add(string cellName)
พารามิเตอร์
cellName
string
ชื่อเซลล์
คืนค่า
ดัชนีของวัตถุ Aspose.Cells.Comment
ตัวอย่าง
int commentIndex2 = comments.Add("B2");
Comment comment2 = comments[commentIndex2];
comment2.Note = "หมายเหตุที่สอง.";
comment2.Font.Name = "Times New Roman";
AddThreadedComment(int, int, string, ThreadedCommentAuthor)
เพิ่มความคิดเห็นแบบเธรด
public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)
พารามิเตอร์
row
int
ดัชนีแถวของเซลล์
column
int
ดัชนีคอลัมน์ของเซลล์
text
string
ข้อความของความคิดเห็น
author
ThreadedCommentAuthor
ผู้ใช้ของความคิดเห็นแบบเธรดนี้
คืนค่า
ดัชนีของวัตถุ Aspose.Cells.ThreadedComment
AddThreadedComment(string, string, ThreadedCommentAuthor)
เพิ่มความคิดเห็นแบบเธรด
public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)
พารามิเตอร์
cellName
string
ชื่อของเซลล์
text
string
ข้อความของความคิดเห็น
author
ThreadedCommentAuthor
ผู้ใช้ของความคิดเห็นแบบเธรดนี้
คืนค่า
ดัชนีของวัตถุ Aspose.Cells.ThreadedComment
Clear()
ลบความคิดเห็นทั้งหมด
public void Clear()
ตัวอย่าง
comments.Clear();
GetThreadedComments(int, int)
รับความคิดเห็นแบบเธรดตามดัชนีแถวและคอลัมน์
public ThreadedCommentCollection GetThreadedComments(int row, int column)
พารามิเตอร์
row
int
ดัชนีแถว
column
int
ดัชนีคอลัมน์
คืนค่า
ตัวอย่าง
ThreadedCommentCollection threadedComments1 = comments.GetThreadedComments(1, 1);
for (int i = 0; i < threadedComments1.Count; ++i)
{
ThreadedComment tc = threadedComments1[i];
string note = tc.Notes;
}
GetThreadedComments(string)
รับความคิดเห็นแบบเธรดตามชื่อเซลล์
public ThreadedCommentCollection GetThreadedComments(string cellName)
พารามิเตอร์
cellName
string
ชื่อของเซลล์
คืนค่า
ตัวอย่าง
ThreadedCommentCollection threadedComments2 = comments.GetThreadedComments("B2");
for (int i = 0; i < threadedComments2.Count; ++i)
{
ThreadedComment tc = threadedComments2[i];
string note = tc.Notes;
}
RemoveAt(string)
ลบความคิดเห็นของเซลล์ที่ระบุ
public void RemoveAt(string cellName)
พารามิเตอร์
cellName
string
ชื่อเซลล์ที่มีความคิดเห็น
ตัวอย่าง
comments.RemoveAt("B2");
RemoveAt(int, int)
ลบความคิดเห็นของเซลล์ที่ระบุ
public void RemoveAt(int row, int column)
พารามิเตอร์
row
int
ดัชนีแถว
column
int
ดัชนีคอลัมน์
ตัวอย่าง
comments.RemoveAt(1,1);