/// <summary> /// Verifying PresentationExtensionList element. /// </summary> /// <param name="filePath">Tartget file path</param> /// <param name="log">Logger</param> public void VerifyAddedElemenet(string filePath, VerifiableLog log) { using (PresentationDocument package = PresentationDocument.Open(filePath, false)) { try { PresentationExtensionList presentationExtensionList = package.PresentationPart.RootElement.Descendants <PresentationExtensionList>().Single(); log.Verify(package.PresentationPart.RootElement.Descendants <PresentationExtensionList>().Count() == 1, "PresentationExtensionList element not exist."); PresentationExtension PresentationExtension1 = presentationExtensionList.Descendants <PresentationExtension>().Where(e => e.Uri == this.SldExtUri).Single(); log.Verify(PresentationExtension1.Count() == 1, "PresentationExtension element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.SlideGuideList>().Count() == 1, "SlideGuideList element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.ExtendedGuide>().Count() == 1, "ExtendedGuide element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.ColorType>().Count() == 1, "ColorType element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <A.RgbColorModelHex>().Count() == 1, "RgbColorModelHex element not exist. By SlideGuide."); PresentationExtension PresentationExtension2 = presentationExtensionList.Descendants <PresentationExtension>().Where(e => e.Uri == this.NotesExtUri).Single(); log.Verify(PresentationExtension2.Count() == 1, "PresentationExtension element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.NotesGuideList>().Count() == 1, "SlideGuideList element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.ExtendedGuide>().Count() == 1, "ExtendedGuide element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.ColorType>().Count() == 1, "ColorType element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <A.RgbColorModelHex>().Count() == 1, "RgbColorModelHex element not exist. By NotesGuide."); } catch (Exception e) { log.Fail(e.Message); } } }
/// <summary> /// Verifying PresentationExtensionList element. /// </summary> /// <param name="stream">Target stream</param> /// <param name="log">Logger</param> public void VerifyAddedElemenet(Stream stream, VerifiableLog log) { using (PresentationDocument package = PresentationDocument.Open(stream, false)) { PresentationExtensionList presentationExtensionList = package.PresentationPart.RootElement.Descendants <PresentationExtensionList>().Single(); log.Verify(package.PresentationPart.RootElement.Descendants <PresentationExtensionList>().Count() == 1, "PresentationExtensionList element not exist."); PresentationExtension PresentationExtension1 = presentationExtensionList.Descendants <PresentationExtension>().Where(e => e.Uri == SldExtUri).Single(); log.Verify(PresentationExtension1.Count() == 1, "PresentationExtension element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.SlideGuideList>().Count() == 1, "SlideGuideList element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.ExtendedGuide>().Count() == 1, "ExtendedGuide element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <P15.ColorType>().Count() == 1, "ColorType element not exist. By SlideGuide."); log.Verify(PresentationExtension1.Descendants <A.RgbColorModelHex>().Count() == 1, "RgbColorModelHex element not exist. By SlideGuide."); PresentationExtension PresentationExtension2 = presentationExtensionList.Descendants <PresentationExtension>().Where(e => e.Uri == NotesExtUri).Single(); log.Verify(PresentationExtension2.Count() == 1, "PresentationExtension element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.NotesGuideList>().Count() == 1, "SlideGuideList element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.ExtendedGuide>().Count() == 1, "ExtendedGuide element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <P15.ColorType>().Count() == 1, "ColorType element not exist. By NotesGuide."); log.Verify(PresentationExtension2.Descendants <A.RgbColorModelHex>().Count() == 1, "RgbColorModelHex element not exist. By NotesGuide."); } }