Class CommentCollection

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

Наслідування

objectCollectionBase<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; }

Значення властивості

Comment

Приклади

Comment comment3 = comments[0];
comment3.Note = "Три примітка.";

this[string]

Отримує елемент Aspose.Cells.Comment за вказаним ім’ям клітинки.

public Comment this[string cellName] { get; }

Значення властивості

Comment

Приклади

Comment comment4 = comments["B2"];
comment4.Note = "Чотири примітка.";

this[int, int]

Отримує елемент Aspose.Cells.Comment за вказаним індексом рядка та стовпця.

public Comment this[int row, int column] { get; }

Значення властивості

Comment

Приклади

Comment comment5 = comments[1,1];
comment5.Note = "П'ять примітка.";

Методи

Add(int, int)

Додає коментар до колекції.

public int Add(int row, int column)

Параметри

row int

Індекс рядка клітинки.

column int

Індекс стовпця клітинки.

Повертає

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

Ім’я клітинки.

Повертає

int

Індекс об’єкта 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

Користувач цього поточного коментаря.

Повертає

int

Індекс об’єкта Aspose.Cells.ThreadedComment.

AddThreadedComment(string, string, ThreadedCommentAuthor)

Додає поточний коментар.

public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)

Параметри

cellName string

Ім’я клітинки.

text string

Текст коментаря

author ThreadedCommentAuthor

Користувач цього поточного коментаря.

Повертає

int

Індекс об’єкта Aspose.Cells.ThreadedComment.

Clear()

Видаляє всі коментарі;

public void Clear()

Приклади

comments.Clear();

GetThreadedComments(int, int)

Отримує поточні коментарі за індексом рядка та стовпця.

public ThreadedCommentCollection GetThreadedComments(int row, int column)

Параметри

row int

Індекс рядка.

column int

Індекс стовпця.

Повертає

ThreadedCommentCollection

Приклади

ThreadedCommentCollection threadedComments1 = comments.GetThreadedComments(1, 1);
for (int i = 0; i &lt; threadedComments1.Count; ++i)
{
    ThreadedComment tc = threadedComments1[i];
    string note = tc.Notes;
}

GetThreadedComments(string)

Отримує поточні коментарі за ім’ям клітинки.

public ThreadedCommentCollection GetThreadedComments(string cellName)

Параметри

cellName string

Ім’я клітинки.

Повертає

ThreadedCommentCollection

Приклади

ThreadedCommentCollection threadedComments2 = comments.GetThreadedComments("B2");
for (int i = 0; i &lt; 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);
 Українська