示例#1
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);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Append the ThreadingInfo element
        /// </summary>
        public void AddElements(Stream stream, VerifiableLog log)
        {
            using (PresentationDocument package = PresentationDocument.Open(stream, true))
            {
                Comment          comment          = GetComment(package.PresentationPart.SlideParts, 1);
                CommentExtension commentExtension = new CommentExtension()
                {
                    Uri = ThreadingInfoExtUri
                };
                P15.ThreadingInfo threadingInfo = new P15.ThreadingInfo()
                {
                    TimeZoneBias = timeZoneBiasValue
                };
                commentExtension.AppendChild <P15.ThreadingInfo>(threadingInfo);
                comment.CommentExtensionList.AppendChild <CommentExtension>(commentExtension);

                log.Pass("Added ThreadingInfo element.");
            }
        }