public static IMedia CreateMediaFolder(IMediaType mediaType, int parentId) { var media = new Media("Test Folder", parentId, mediaType) { CreatorId = 0 }; return media; }
public static IMedia CreateMediaFile(IMediaType mediaType, int parentId) { var media = new Media("Test File", parentId, mediaType) { CreatorId = 0 }; media.SetValue("umbracoFile", "/media/test-file.txt"); media.SetValue("umbracoBytes", "4"); media.SetValue("umbracoExtension", "txt"); return media; }
public static IMedia CreateMediaFile(IMediaType mediaType, int parentId) { var media = new Media("Test File", parentId, mediaType) { CreatorId = 0 }; media.SetValue(Constants.Conventions.Media.File, "/media/test-file.txt"); media.SetValue(Constants.Conventions.Media.Bytes, "4"); media.SetValue(Constants.Conventions.Media.Extension, "txt"); return media; }
public static IMedia CreateMediaImage(IMediaType mediaType, int parentId) { var media = new Media("Test Image", parentId, mediaType) { CreatorId = 0 }; media.SetValue("umbracoFile", "/media/test-image.png"); media.SetValue("umbracoWidth", "200"); media.SetValue("umbracoHeight", "200"); media.SetValue("umbracoBytes", "100"); media.SetValue("umbracoExtension", "png"); return media; }
public static IMedia CreateMediaImage(IMediaType mediaType, int parentId) { var media = new Media("Test Image", parentId, mediaType) { CreatorId = 0 }; media.SetValue(Constants.Conventions.Media.File, "/media/test-image.png"); media.SetValue(Constants.Conventions.Media.Width, "200"); media.SetValue(Constants.Conventions.Media.Height, "200"); media.SetValue(Constants.Conventions.Media.Bytes, "100"); media.SetValue(Constants.Conventions.Media.Extension, "png"); return media; }
private TImage GetImage(uMedia uMedia) { _validationService.ValidateExtension(uMedia); return(Convert(uMedia)); }
public void Move(Umbraco.Core.Models.Media image, int parentId) { _imageRepository.Move(image, parentId); }