Exemple #1
0
 public virtual void DeletePicture(string name, int?height, int?width)
 {
     if (!BaseSecurity.HasChalkableRole(Context))
     {
         throw new ChalkableSecurityException();
     }
     ServiceLocator.StorageBlobService.DeleteBlob(PICTURE_CONTAINER_NAME, PictureName(name, height, width));
 }
Exemple #2
0
        public virtual void UploadPicture(string name, byte[] content, int?height, int?width)
        {
            if (!BaseSecurity.HasChalkableRole(Context))
            {
                throw new ChalkableSecurityException();
            }
            if (height.HasValue && width.HasValue)
            {
                content = ImageUtils.Scale(content, width.Value, height.Value);
            }

            ServiceLocator.StorageBlobService.AddBlob(PICTURE_CONTAINER_NAME, PictureName(name, height, width), content);
        }