Ejemplo n.º 1
0
        // Generates content of slideCommentsPart1.
        private void GenerateSlideCommentsPart1Content(SlideCommentsPart slideCommentsPart1)
        {
            CommentList commentList1 = new CommentList();
            commentList1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            commentList1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            commentList1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            Comment comment1 = new Comment(){ AuthorId = (UInt32Value)0U, DateTime = System.Xml.XmlConvert.ToDateTime("2008-01-03T13:29:23.575Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind), Index = (UInt32Value)1U };
            Position position1 = new Position(){ X = 10L, Y = 10L };
            Text text8 = new Text();
            text8.Text = "TEsting Comment";

            CommentExtensionList commentExtensionList1 = new CommentExtensionList();

            CommentExtension commentExtension1 = new CommentExtension(){ Uri = "{C676402C-5697-4E1C-873F-D02D1690AC5C}" };

            P15.ThreadingInfo threadingInfo1 = new P15.ThreadingInfo(){ TimeZoneBias = -540 };
            threadingInfo1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            commentExtension1.Append(threadingInfo1);

            commentExtensionList1.Append(commentExtension1);

            comment1.Append(position1);
            comment1.Append(text8);
            comment1.Append(commentExtensionList1);

            Comment comment2 = new Comment(){ AuthorId = (UInt32Value)0U, DateTime = System.Xml.XmlConvert.ToDateTime("2008-01-03T13:29:45.682Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind), Index = (UInt32Value)2U };
            Position position2 = new Position(){ X = 2721L, Y = 913L };
            Text text9 = new Text();
            text9.Text = "TEsting Comment";

            CommentExtensionList commentExtensionList2 = new CommentExtensionList();

            CommentExtension commentExtension2 = new CommentExtension(){ Uri = "{C676402C-5697-4E1C-873F-D02D1690AC5C}" };

            P15.ThreadingInfo threadingInfo2 = new P15.ThreadingInfo(){ TimeZoneBias = -540 };
            threadingInfo2.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            commentExtension2.Append(threadingInfo2);

            commentExtensionList2.Append(commentExtension2);

            comment2.Append(position2);
            comment2.Append(text9);
            comment2.Append(commentExtensionList2);

            commentList1.Append(comment1);
            commentList1.Append(comment2);

            slideCommentsPart1.CommentList = commentList1;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Append the ThreadingInfo element
        /// </summary>
        /// <param name="filePath">Target excel faile path</param>
        /// <param name="log">Logger</param>
        public void AddElements(string filePath, VerifiableLog log)
        {
            using (PresentationDocument package = PresentationDocument.Open(filePath, true))
            {
                try
                {
                    Comment comment = GetComment(package.PresentationPart.SlideParts, 1);
                    CommentExtension commentExtension = new CommentExtension() { Uri = this.ThreadingInfoExtUri };
                    P15.ThreadingInfo threadingInfo = new P15.ThreadingInfo() { TimeZoneBias = this.timeZoneBiasValue };
                    commentExtension.AppendChild<P15.ThreadingInfo>(threadingInfo);
                    comment.CommentExtensionList.AppendChild<CommentExtension>(commentExtension);

                    log.Pass("Added ThreadingInfo element.");
                }
                catch (Exception e)
                {
                    log.Fail(e.Message);
                }
            }
        }