From c6e2052b69550dbc766c15a9736e2f2dc422a26a Mon Sep 17 00:00:00 2001 From: vderyushev Date: Tue, 13 Aug 2024 15:17:47 +0300 Subject: [PATCH] Updated examples --- Examples/ApiExamples/ApiExamples/ExComment.cs | 6 +++--- Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Examples/ApiExamples/ApiExamples/ExComment.cs b/Examples/ApiExamples/ApiExamples/ExComment.cs index d1941a8f..deccca7a 100644 --- a/Examples/ApiExamples/ApiExamples/ExComment.cs +++ b/Examples/ApiExamples/ApiExamples/ExComment.cs @@ -109,18 +109,18 @@ public void RemoveCommentReplies() comment.AddReply("Joe Bloggs", "J.B.", DateTime.Now, "New reply"); comment.AddReply("Joe Bloggs", "J.B.", DateTime.Now, "Another reply"); - Assert.AreEqual(2, comment.Replies.Count()); + Assert.AreEqual(2, comment.Replies.Count); // Below are two ways of removing replies from a comment. // 1 - Use the "RemoveReply" method to remove replies from a comment individually: comment.RemoveReply(comment.Replies[0]); - Assert.AreEqual(1, comment.Replies.Count()); + Assert.AreEqual(1, comment.Replies.Count); // 2 - Use the "RemoveAllReplies" method to remove all replies from a comment at once: comment.RemoveAllReplies(); - Assert.AreEqual(0, comment.Replies.Count()); + Assert.AreEqual(0, comment.Replies.Count); //ExEnd } diff --git a/Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs index f96cf2fd..17cd32dc 100644 --- a/Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs +++ b/Examples/ApiExamples/ApiExamples/ExXpsSaveOptions.cs @@ -170,9 +170,11 @@ public void XpsDigitalSignature() Document doc = new Document(MyDir + "Document.docx"); CertificateHolder certificateHolder = CertificateHolder.Create(MyDir + "morzal.pfx", "aw"); - DigitalSignatureDetails digitalSignatureDetails = new DigitalSignatureDetails( - certificateHolder, - new SignOptions() { Comments = "Some comments", SignTime = DateTime.Now }); + SignOptions options = new SignOptions(); + options.SignTime = DateTime.Now; + options.Comments = "Some comments"; + + DigitalSignatureDetails digitalSignatureDetails = new DigitalSignatureDetails(certificateHolder, options); XpsSaveOptions saveOptions = new XpsSaveOptions(); saveOptions.DigitalSignatureDetails = digitalSignatureDetails;