Class CommentCollection

Class CommentCollection

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

Incapsula una collezione di oggetti Aspose.Cells.Comment.

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

Ereditarietà

objectCollectionBase<comment>CommentCollection

Implementa

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

Membri Ereditati

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

Esempi

Workbook workbook = new Workbook();

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

//esegui la tua logica
Dim workbook as Workbook = new Workbook()

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

Proprietà

this[int]

Ottiene l’elemento Aspose.Cells.Comment all’indice specificato.

public Comment this[int index] { get; }

Valore della Proprietà

Comment

Esempi

Comment comment3 = comments[0];
comment3.Note = "Tre note.";

this[string]

Ottiene l’elemento Aspose.Cells.Comment nella cella specificata.

public Comment this[string cellName] { get; }

Valore della Proprietà

Comment

Esempi

Comment comment4 = comments["B2"];
comment4.Note = "Quattro note.";

this[int, int]

Ottiene l’elemento Aspose.Cells.Comment all’indice di riga e colonna specificati.

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

Valore della Proprietà

Comment

Esempi

Comment comment5 = comments[1,1];
comment5.Note = "Cinque note.";

Metodi

Add(int, int)

Aggiunge un commento alla collezione.

public int Add(int row, int column)

Parametri

row int

Indice di riga della cella.

column int

Indice di colonna della cella.

Restituisce

int

Indice dell’oggetto Aspose.Cells.Comment.

Esempi

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

Add(string)

Aggiunge un commento alla collezione.

public int Add(string cellName)

Parametri

cellName string

Nome della cella.

Restituisce

int

Indice dell’oggetto Aspose.Cells.Comment.

Esempi

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

AddThreadedComment(int, int, string, ThreadedCommentAuthor)

Aggiunge un commento a thread.

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

Parametri

row int

Indice di riga della cella.

column int

Indice di colonna della cella.

text string

Il testo del commento.

author ThreadedCommentAuthor

L’utente di questo commento a thread.

Restituisce

int

Indice dell’oggetto Aspose.Cells.ThreadedComment.

AddThreadedComment(string, string, ThreadedCommentAuthor)

Aggiunge un commento a thread.

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

Parametri

cellName string

Il nome della cella.

text string

Il testo del commento.

author ThreadedCommentAuthor

L’utente di questo commento a thread.

Restituisce

int

Indice dell’oggetto Aspose.Cells.ThreadedComment.

Clear()

Rimuove tutti i commenti;

public void Clear()

Esempi

comments.Clear();

GetThreadedComments(int, int)

Ottiene i commenti a thread per indice di riga e colonna.

public ThreadedCommentCollection GetThreadedComments(int row, int column)

Parametri

row int

L’indice di riga.

column int

L’indice di colonna.

Restituisce

ThreadedCommentCollection

Esempi

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)

Ottiene i commenti a thread per nome della cella.

public ThreadedCommentCollection GetThreadedComments(string cellName)

Parametri

cellName string

Il nome della cella.

Restituisce

ThreadedCommentCollection

Esempi

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

RemoveAt(string)

Rimuove il commento della cella specifica.

public void RemoveAt(string cellName)

Parametri

cellName string

Il nome della cella che contiene un commento.

Esempi

comments.RemoveAt("B2");

RemoveAt(int, int)

Rimuove il commento della cella specifica.

public void RemoveAt(int row, int column)

Parametri

row int

L’indice di riga.

column int

L’indice di colonna.

Esempi

comments.RemoveAt(1,1);
 Italiano