public virtual void PassTo(SWAFile template) { template.UpdateText(Name, GetValue()); }
public ActionConfirmation CreateFromTemplate(int userId, int slidefolderId, IList <int> assetContentIds, int templateId, string caption, string credit) { string templatePath = (string)System.Configuration.ConfigurationSettings.AppSettings["templatePath"]; //TODO Ensure user owns slidefolder var bUseTemplate = (templateId != 0); foreach (var assetContentId in assetContentIds) { var assetContent = this.assetContentRepository.Get(assetContentId); var template = this.templateRepository.Get(templateId); var extension = bUseTemplate ? ".swf" : assetContent.FilenameExtension; var slide = new Slide(extension); slide.SlideFolderID = slidefolderId; slide.Caption = caption; slide.ClickThroughURL = assetContent.URL; slide.Creator = credit; slide.UserGivenDate = assetContent.UserGivenDate; slide.Name = assetContent.Name; if (bUseTemplate) { slide.DisplayDuration = template.DisplayDuration; slide.PreviewType = "Flash"; slide.PlayerType = "Flash"; var slideFromTemplate = new SWAFile(template.FileFullPathName); slideFromTemplate.UpdateBitmap("MasterImage", Image.FromFile(assetContent.FileFullPathName)); slideFromTemplate.UpdateText("TitleText", caption); slideFromTemplate.UpdateText("ImageCreditText", credit); //Aspose has a bug with getting thumbnail so use the asset content image for now //var image = slideFromTemplate.GetThumbnail(); //ImageUtilities.Crop(image, 100, 75, AnchorPosition.Center).Save(slide.ThumbnailFullPathName); File.Copy(assetContent.ThumbnailFullPathName, slide.ThumbnailFullPathName); slideFromTemplate.Save(slide.FileFullPathName); slide.Length = (int)new FileInfo(slide.FileFullPathName).Length; } else { slide.DisplayDuration = assetContent.DisplayDuration; slide.PreviewType = assetContent.PreviewType; if (slide.PreviewType == "Image") { slide.PlayerType = "Image"; } else if (slide.PreviewType == "Flash") { slide.PlayerType = "Flash"; } else if (slide.FilenameExtension == ".mov") { slide.PlayerType = "VideoQT"; } else { slide.PlayerType = "VideoNonQT"; } slide.Length = assetContent.Length; File.Copy(assetContent.FileFullPathName, slide.FileFullPathName); File.Copy(assetContent.ThumbnailFullPathName, slide.ThumbnailFullPathName); //TODO: ExtractThumbnails(slideContents) //ExtractThumbnails(slideContents); } slideRepository.SaveOrUpdate(slide); } return(ActionConfirmation.CreateSuccessConfirmation("Slide successfully create")); }
public void CanSeeLinkedText() { var file = new SWAFile(@"C:\Users\Ashter\Desktop\Guardian_20110420_3.swf"); file.UpdateText("TitleTest", "Test"); }