Interface IComments
Represents the comment collection.
Inherited Members
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IComments : IEnumerable<IComment>, IEnumerable
Properties
Count
Gets the number of elements in the comment collection. Read-only.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The total count of the comments. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Get the count comment
int count = slide.Comments.Count;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Get the count of the comment
Dim count As Integer = slide.Comments.Count
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Item[Int32]
Gets the IComment instance at the specified index in comment collection. Read-only.
Declaration
IComment this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to locate the comment. |
Property Value
Type | Description |
---|---|
IComment | Returns the IComment instance at the specified index in comment collection. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Get the comment
IComment comment1 = slide.Comments[1];
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Get the comment
Dim comment1 As IComment = slide.Comments(1)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Methods
Add(Double, Double, String, String, String, DateTime)
Adds a comment for an author in the slide.
Declaration
IComment Add(double left, double top, string authorName, string authorInitials, string text, DateTime dateTime)
Parameters
Type | Name | Description |
---|---|---|
System.Double | left | left poisiton of the comment in slide |
System.Double | top | top position of comment in slide |
System.String | authorName | name of the comment author |
System.String | authorInitials | initial of the author |
System.String | text | specifies the comment |
System.DateTime | dateTime | specifies the date time of the comment added |
Returns
Type | Description |
---|---|
IComment | Returns the IComment instance of added comment. |
Remarks
The comment gets added in the slide
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Add(String, String, String, DateTime, IComment)
Adds a reply for an author to a specific comment.
Declaration
IComment Add(string authorName, string initials, string replyText, DateTime dateTime, IComment parent)
Parameters
Type | Name | Description |
---|---|---|
System.String | authorName | name of the comment author |
System.String | initials | initial of the author |
System.String | replyText | specifies the comment |
System.DateTime | dateTime | specifies the date time of the reply added |
IComment | parent | specifies the parent comment |
Returns
Type | Description |
---|---|
IComment | Returns the IComment instance of added comment. |
Remarks
The reply is made to a comment added in the slide
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Clear()
Removes all the comments in the slide.
Declaration
void Clear()
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment1 = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
IComment comment2 = slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment1);
//Clear the comment from the slide
slide.Comments.Clear();
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment1 As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
Dim comment2 As IComment = slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment1)
'Clear the comment from the slide
slide.Comments.Clear()
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
IndexOf(IComment)
Returns the zero-based index of the first occurrence of the IComment instance within the comment collection.
Declaration
int IndexOf(IComment comment)
Parameters
Type | Name | Description |
---|---|---|
IComment | comment | The IComment instance to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the first occurrence of comment within the collection, if found; otherwise, –1. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Get the index of the comment from the comment collection
int index = slide.Comments.IndexOf(comment);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Get the index of the comment from the comment collection
Dim index As Integer = slide.Comments.IndexOf(comment)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Insert(Int32, IComment)
Inserts the specified comment into the comment collection at specified index.
Declaration
void Insert(int index, IComment comment)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the comment should be inserted. |
IComment | comment | The comment instance to insert. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment1 = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
IComment comment2 = slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment1);
//Insert the comment at the specified index in comment collection
slide.Comments.Insert(0 , comment2);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment1 As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
Dim comment2 As IComment = slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment1)
'Insert the comment at the specified index in comment collection
slide.Comments.Insert(0,comment2)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Remove(IComment)
Removes the first occurrence of a specified comment from the comment collection.
Declaration
void Remove(IComment comment)
Parameters
Type | Name | Description |
---|---|---|
IComment | comment | The comment to be removed from the collection. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Remove the comment at the specified index from the comment collection
slide.Comments.Remove(comment);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Remove the comment at the specified index from the comment collection
slide.Comments.Remove(comment)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
RemoveAt(Int32)
Removes the comment at the specified index, from the comment collection.
Declaration
void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to be removed. |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Remove the comment at the specified index
slide.Comments.RemoveAt(1);
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Remove the comment at the specified index
slide.Comments.RemoveAt(1)
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()