Class CommentCollection

Class CommentCollection

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Encapsula uma coleção de objetos Aspose.Cells.Comment.

public class CommentCollection : CollectionBase<comment>, IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable

Herança

objectCollectionBase<comment>CommentCollection

Implementa

IList<comment>, ICollection<comment>, IEnumerable<comment>, ICollection, IEnumerable

Membros Herdados

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()

Exemplos

Workbook workbook = new Workbook();

CommentCollection comments = workbook.Worksheets[0].Comments;

//faça seu trabalho
Dim workbook as Workbook = new Workbook()

Dim comments as CommentCollection = workbook.Worksheets(0).Comments

Propriedades

this[int]

Obtém o elemento Aspose.Cells.Comment no índice especificado.

public Comment this[int index] { get; }

Valor da Propriedade

Comment

Exemplos

Comment comment3 = comments[0];
comment3.Note = "Três nota.";

this[string]

Obtém o elemento Aspose.Cells.Comment na célula especificada.

public Comment this[string cellName] { get; }

Valor da Propriedade

Comment

Exemplos

Comment comment4 = comments["B2"];
comment4.Note = "Quatro nota.";

this[int, int]

Obtém o elemento Aspose.Cells.Comment no índice de linha e coluna especificados.

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

Valor da Propriedade

Comment

Exemplos

Comment comment5 = comments[1,1];
comment5.Note = "Cinco nota.";

Métodos

Add(int, int)

Adiciona um comentário à coleção.

public int Add(int row, int column)

Parâmetros

row int

Índice da linha da célula.

column int

Índice da coluna da célula.

Retorna

int

Índice do objeto Aspose.Cells.Comment.

Exemplos

int commentIndex1 = comments.Add(0, 0);
Comment comment1 = comments[commentIndex1];
comment1.Note = "Primeira nota.";
comment1.Font.Name = "Times New Roman";

Add(string)

Adiciona um comentário à coleção.

public int Add(string cellName)

Parâmetros

cellName string

Nome da célula.

Retorna

int

Índice do objeto Aspose.Cells.Comment.

Exemplos

int commentIndex2 = comments.Add("B2");
Comment comment2 = comments[commentIndex2];
comment2.Note = "Segunda nota.";
comment2.Font.Name = "Times New Roman";

AddThreadedComment(int, int, string, ThreadedCommentAuthor)

Adiciona um comentário em thread.

public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)

Parâmetros

row int

Índice da linha da célula.

column int

Índice da coluna da célula.

text string

O texto do comentário

author ThreadedCommentAuthor

O usuário deste comentário em thread.

Retorna

int

Índice do objeto Aspose.Cells.ThreadedComment.

AddThreadedComment(string, string, ThreadedCommentAuthor)

Adiciona um comentário em thread.

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

Parâmetros

cellName string

O nome da célula.

text string

O texto do comentário

author ThreadedCommentAuthor

O usuário deste comentário em thread.

Retorna

int

Índice do objeto Aspose.Cells.ThreadedComment.

Clear()

Remove todos os comentários;

public void Clear()

Exemplos

comments.Clear();

GetThreadedComments(int, int)

Obtém os comentários em thread pelo índice de linha e coluna.

public ThreadedCommentCollection GetThreadedComments(int row, int column)

Parâmetros

row int

O índice da linha.

column int

O índice da coluna.

Retorna

ThreadedCommentCollection

Exemplos

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)

Obtém os comentários em thread pelo nome da célula.

public ThreadedCommentCollection GetThreadedComments(string cellName)

Parâmetros

cellName string

O nome da célula.

Retorna

ThreadedCommentCollection

Exemplos

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

RemoveAt(string)

Remove o comentário da célula específica.

public void RemoveAt(string cellName)

Parâmetros

cellName string

O nome da célula que contém um comentário.

Exemplos

comments.RemoveAt("B2");

RemoveAt(int, int)

Remove o comentário da célula específica.

public void RemoveAt(int row, int column)

Parâmetros

row int

O índice da linha.

column int

o índice da coluna.

Exemplos

comments.RemoveAt(1,1);
 Português