public void TestTempPathInit() { try { TempPath.GetPath("some-name"); Assert.Fail(); } catch (Exception) { } }
public void TestTempPathInit2() { try { TempPath.InitTempFolder(); TempPath.GetPath("some-name"); } catch (Exception) { Assert.Fail(); } }
public void TestApplyStyle() { TempPath.InitTempFolder(); foreach (StyleOption style in _factory.GetAllStylesPreviewOptions()) { _designer.ApplyStyle(_sourceImage, _contentSlide, Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight, style); string imgPath = TempPath.GetPath("applystyle-" + Guid.NewGuid().ToString().Substring(0, 7) + "-" + DateTime.Now.GetHashCode()); _contentSlide.Export(imgPath, "JPG"); SlideUtil.IsSameLooking( new FileInfo(PathUtil.GetDocTestPath() + "PictureSlidesLab\\" + style.StyleName + ".jpg"), new FileInfo(imgPath)); } }
private void AddSlideThumbnail(PowerPointSlide slide, int pos = -1, bool isCurrentSlide = false) { if (slide == null) { return; } var thumbnailPath = TempPath.GetPath("slide-" + DateTime.Now.GetHashCode() + slide.Index); slide.GetNativeSlide().Export(thumbnailPath, "JPG", GetPreviewWidth(), PreviewHeight); ImageItem imageItem; if (isCurrentSlide) { imageItem = new ImageItem { ImageFile = thumbnailPath, Tooltip = "(Current) Slide " + slide.Index }; } else { imageItem = new ImageItem { ImageFile = thumbnailPath, Tooltip = "Slide " + slide.Index }; } Dispatcher.Invoke(new Action(() => { if (pos == -1) { SlideList.Add(imageItem); } else { SlideList.Insert(pos, imageItem); } })); }
public PreviewInfo() { PreviewApplyStyleImagePath = TempPath.GetPath("previewapply"); }