private static PresentationPart MakeValidPresentationPart(PresentationPart presentationPart) { // // Presentation // PresentationBuilder.MakeValidPresentation( presentationPart.Presentation ?? (presentationPart.Presentation = new Presentation()) ).Save(presentationPart); // // ViewPropertiesPart // PresentationBuilder.MakeValidViewPropertiesPart( presentationPart.ViewPropertiesPart ?? presentationPart.AddNewPartDefaultId <ViewPropertiesPart>() ); // // PresentationPropertiesPart // PresentationBuilder.MakeValidPresentationPropertiesPart( presentationPart.PresentationPropertiesPart ?? presentationPart.AddNewPartDefaultId <PresentationPropertiesPart>() ); return(presentationPart); }
private static PresentationPropertiesPart MakeValidPresentationPropertiesPart(PresentationPropertiesPart presentationPropertiesPart) { PresentationBuilder.MakeValidPresentationProperties( presentationPropertiesPart.PresentationProperties ?? (presentationPropertiesPart.PresentationProperties = new PresentationProperties()) ).Save(presentationPropertiesPart); return(presentationPropertiesPart); }
private static ViewPropertiesPart MakeValidViewPropertiesPart(ViewPropertiesPart viewPropertiesPart) { PresentationBuilder.MakeValidViewProperties( viewPropertiesPart.ViewProperties ?? (viewPropertiesPart.ViewProperties = new ViewProperties()) ).Save(viewPropertiesPart); return(viewPropertiesPart); }
public static PresentationDocument BuildDefault(PresentationDocument presentationDocument) { PresentationBuilder.BuildPresentationScaffold(presentationDocument); PresentationPart presentationPart = presentationDocument.PresentationPart; ThemeApplier.ApplyTheme(presentationPart, DefaultThemeBuilder.BuildDefaultTheme()); ThemeApplier.ApplyTableStyles(presentationPart, DefaultThemeBuilder.BuildDefaultTableStyleList()); ThemeApplier.AppendSlideMaster(presentationPart, DefaultSlideMasterBuilder.BuildDefaultSlideMaster(), DefaultSlideMasterBuilder.BuildDefaultSlideLayouts()); return(presentationDocument); }
private static PresentationDocument BuildPresentationScaffold(PresentationDocument presentationDocument) { presentationDocument.DeletePartsRecursivelyOfType <PresentationPart>(); presentationDocument.DeletePartsRecursivelyOfType <CoreFilePropertiesPart>(); presentationDocument.DeletePartsRecursivelyOfType <ExtendedFilePropertiesPart>(); presentationDocument.ChangeIdOfPart(presentationDocument.AddPresentationPart(), "rId1"); PresentationBuilder.MakeValidPresentationPart(presentationDocument.PresentationPart); presentationDocument.ChangeIdOfPart(presentationDocument.AddCoreFilePropertiesPart(), "rId2"); PresentationBuilder.MakeValidCoreFilePropertiesPart(presentationDocument.CoreFilePropertiesPart); presentationDocument.ChangeIdOfPart(presentationDocument.AddExtendedFilePropertiesPart(), "rId3"); PresentationBuilder.MakeValidExtendedFilePropertiesPart(presentationDocument.ExtendedFilePropertiesPart); return(presentationDocument); }
public static PresentationDocument BuildFromThemeDocument(PresentationDocument presentationDocument, PresentationDocument themePresentationDocument) { PresentationBuilder.BuildPresentationScaffold(presentationDocument); PresentationPart presentationPart = presentationDocument.PresentationPart; PresentationPart themePresentationPart = themePresentationDocument.PresentationPart; ThemeApplier.ApplyTheme(presentationPart, themePresentationPart.ThemePart.Theme); ThemeApplier.ApplyTableStyles(presentationPart, themePresentationPart.TableStylesPart.TableStyleList); foreach (SlideMasterPart themeSlideMasterPart in themePresentationPart.SlideMasterParts) { // ThemeApplier.AppendSlideMaster(presentationPart, themeSlideMasterPart.SlideMaster, ThemeApplier.ExtractSlideLayouts(themeSlideMasterPart)); ThemeApplier.AppendSlideMasterFromPart(presentationPart, themePresentationPart, themeSlideMasterPart); } return(presentationDocument); }