Beispiel #1
0
        public void CreateShapeModernComment()
        {
            int textSelectionStartIndex = 1;
            int textSellectionLength    = 5;

            SlideModernComment childComment = new SlideModernComment()
            {
                Author = c_author,
                Text   = c_childCommentText,
                Status = SlideModernComment.StatusEnum.Resolved
            };
            SlideModernComment comment = new SlideModernComment
            {
                Author              = c_author,
                Text                = c_commentText,
                Status              = SlideModernComment.StatusEnum.Active,
                TextSelectionStart  = textSelectionStartIndex,
                TextSelectionLength = textSellectionLength,
                ChildComments       = new List <SlideCommentBase>()
                {
                    childComment
                }
            };

            TestUtils.Upload(c_fileName, c_folderName + "/" + c_fileName);
            SlideComments response = TestUtils.SlidesApi.CreateComment(c_fileName, 3, comment, c_shapeIndex, c_password, c_folderName);

            Assert.AreEqual(1, response.List.Count);
            Assert.IsInstanceOf(typeof(SlideModernComment), response.List[0]);
        }
Beispiel #2
0
        public void CreateComment()
        {
            SlideComment dto = new SlideComment()
            {
                Text          = c_commentText,
                Author        = c_author,
                ChildComments = new List <SlideCommentBase>()
                {
                    new SlideComment()
                    {
                        Text   = c_childCommentText,
                        Author = c_author
                    }
                }
            };

            TestUtils.Upload(c_fileName, c_folderName + "/" + c_fileName);
            SlideComments response = TestUtils.SlidesApi.CreateComment(c_fileName, 3, dto, null, c_password, c_folderName);

            Assert.AreEqual(1, response.List.Count);
            Assert.AreEqual(c_commentText, response.List[0].Text);
            Assert.AreEqual(c_author, response.List[0].Author);
            Assert.AreEqual(c_childCommentText, response.List[0].ChildComments[0].Text);
            Assert.AreEqual(c_author, response.List[0].ChildComments[0].Author);
        }
Beispiel #3
0
        public void DeleteComments()
        {
            TestUtils.Upload(c_fileName, c_folderName + "/" + c_fileName);
            TestUtils.SlidesApi.DeleteComments(c_fileName, null, c_password, c_folderName);
            SlideComments response = TestUtils.SlidesApi.GetSlideComments(c_fileName, c_slideIndex, c_password, c_folderName);

            Assert.AreEqual(0, response.List.Count);
        }
Beispiel #4
0
        public void GetSlideComments()
        {
            TestUtils.Upload(c_fileName, c_folderName + "/" + c_fileName);
            SlideComments response = TestUtils.SlidesApi.GetSlideComments(c_fileName, c_slideIndex, c_password, c_folderName);

            Assert.AreEqual(2, response.List.Count);
            Assert.AreEqual(1, response.List[0].ChildComments.Count);
        }
Beispiel #5
0
        public static void Run()
        {
            // ExStart:1
            SlidesApi  slidesApi  = new SlidesApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName   = "sample-input.pptx";
            int    slideIndex = 1;
            String folder     = "";
            String storage    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Slides Cloud SDK API to get comments of a slide
                SlideCommentsResponse apiResponse = slidesApi.GetSlidesSlideComments(fileName, slideIndex, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    SlideComments slideComments = apiResponse.SlideComments;

                    foreach (SlideComment slideComment in slideComments.List)
                    {
                        Console.WriteLine("Author :: " + slideComment.Author);
                        Console.WriteLine("Text :: " + slideComment.Text);
                    }
                    Console.WriteLine("Get Comments of a PowerPoint Slide, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }