示例#1
0
         public static IMedia CreateMediaFolder(IMediaType mediaType, int parentId)
         {
             var media = new Media("Test Folder", parentId, mediaType)
                             {
                                 CreatorId = 0
                             };

             return media;
         }
示例#2
0
         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;
         }
示例#3
0
         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;
         }
示例#4
0
         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;
         }
示例#5
0
         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;
         }
示例#6
0
 private TImage GetImage(uMedia uMedia)
 {
     _validationService.ValidateExtension(uMedia);
     return(Convert(uMedia));
 }
示例#7
0
 public void Move(Umbraco.Core.Models.Media image, int parentId)
 {
     _imageRepository.Move(image, parentId);
 }