public void UpdateSizeInfo(PowerPointProcessor powerPointProcessor) { double height; double width; powerPointProcessor.GetPresentationProperties(ParentFileLink.FullPath, out width, out height); Width = width; Height = height; }
public void UpdatePresentationInfo(PowerPointProcessor powerPointProcessor, bool force = false) { var sourceFile = new FileInfo(ParentFileLink.FullPath); if (!sourceFile.Exists) return; if (LastPresentationInfoUpdate.HasValue && LastPresentationInfoUpdate == sourceFile.LastWriteTime) return; UpdateSizeInfo(powerPointProcessor); UpdateThemes(powerPointProcessor); LastPresentationInfoUpdate = sourceFile.LastWriteTime; }
public void UpdateQuickViewContent(PowerPointProcessor powerPointProcessor) { var parentFile = new FileInfo(ParentFileLink.FullPath); var previewFolder = new DirectoryInfo(ContainerPath); var needToUpdate = false; if (!previewFolder.Exists || !previewFolder.GetFiles().Any()) needToUpdate = true; else if (parentFile.LastWriteTime > previewFolder.CreationTime) needToUpdate = true; if (!needToUpdate) return; ClearQuickViewContent(); if (!Directory.Exists(Path.Combine(ParentFileLink.ParentLibrary.Path, Constants.RegularPreviewContainersRootFolderName))) Directory.CreateDirectory(Path.Combine(ParentFileLink.ParentLibrary.Path, Constants.RegularPreviewContainersRootFolderName)); Directory.CreateDirectory(ContainerPath); powerPointProcessor.ExportPresentationAsImages(ParentFileLink.FullPath, ContainerPath); PngHelper.ConvertFiles(ContainerPath); }
private void UpdateThemes(PowerPointProcessor powerPointProcessor) { powerPointProcessor.RenameDefaultOfficeDesigns(ParentFileLink.FullPath); }