/// <summary> /// Deleting ThreadingInfo element /// </summary> public void DeleteElements(Stream stream, VerifiableLog log) { using (PresentationDocument package = PresentationDocument.Open(stream, true)) { Comment comment = GetComment(package.PresentationPart.SlideParts, 1); CommentExtension commentExtension = comment.CommentExtensionList.Descendants <CommentExtension>().Where(e => e.Uri == ThreadingInfoExtUri).Single(); P15.ThreadingInfo threadingInfo = commentExtension.Descendants <P15.ThreadingInfo>().Single(); threadingInfo.Remove(); log.Pass("Deleted ThreadingInfo element."); commentExtension.Remove(); log.Pass("Deleted ThreadingInfo extension element."); } }
/// <summary> /// Deleting ThreadingInfo element /// </summary> /// <param name="filePath">Target Excel faile path</param> /// <param name="log">Logger</param> public void DeleteElements(string filePath, VerifiableLog log) { using (PresentationDocument package = PresentationDocument.Open(filePath, true)) { try { Comment comment = GetComment(package.PresentationPart.SlideParts, 1); CommentExtension commentExtension = comment.CommentExtensionList.Descendants <CommentExtension>().Where(e => e.Uri == this.ThreadingInfoExtUri).Single(); P15.ThreadingInfo threadingInfo = commentExtension.Descendants <P15.ThreadingInfo>().Single(); threadingInfo.Remove(); log.Pass("Deleted ThreadingInfo element."); commentExtension.Remove(); log.Pass("Deleted ThreadingInfo extension element."); } catch (Exception e) { log.Fail(e.Message); } } }