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);
 日本語