JsonResult IDriver.Rotate(string target, int degree)
        {
            FullPath path = ParsePath(target);

            path.Root.PicturesEditor.Rotate(path.File.FullName, degree);
            var output = new ChangedResponse();

            output.Changed.Add((FileDTO)DTOBase.Create(path.File, path.Root));
            return(Json(output));
        }
        JsonResult IDriver.Crop(string target, int x, int y, int width, int height)
        {
            var path = ParsePath(target);

            path.Root.PicturesEditor.Crop(path.File.FullName, x, y, width, height);
            var output = new ChangedResponse();

            output.Changed.Add((FileDTO)DTOBase.Create(path.File, path.Root));
            return(Json(output));
        }
        JsonResult IDriver.Resize(string target, int width, int height)
        {
            FullPath path = ParsePath(target);

            RemoveThumbs(path);
            path.Root.PicturesEditor.Resize(path.File.FullName, width, height);
            var output = new ChangedResponse();

            output.Changed.Add((FileDTO)DTOBase.Create(path.File, path.Root));
            return(Json(output));
        }
        JsonResult IDriver.Put(string target, string content)
        {
            FullPath        fullPath = ParsePath(target);
            ChangedResponse answer   = new ChangedResponse();

            using (StreamWriter writer = new StreamWriter(fullPath.File.FullName, false))
            {
                writer.Write(content);
            }
            answer.Changed.Add((FileDTO)DTOBase.Create(fullPath.File, fullPath.Root));
            return(Json(answer));
        }
        JsonResult IDriver.Put(string target, string content)
        {
            var fullPath = ParsePath(target);
            var answer   = new ChangedResponse();

            using (var blob = BlobFactory.GetBlobStorage(fullPath.File.ResourceId, BlobFactory.Container.Resources)) {
                blob.Content = Encoding.ASCII.GetBytes(content);
                blob.Save();
            }
            answer.Changed.Add((FileDTO)DTOBase.Create(fullPath.File, fullPath.Root));
            return(Json(answer));
        }
Exemple #6
0
        JsonResult IDriver.Rotate(string target, int degree)
        {
            WebDavRoot lroot = this.GetRoot(target);

            target = this.GetCorectTarget(target);
            string decodedTarget = this.DecodeTarget(target);
            WebDavPicturesEditor pictureEditor = new WebDav.WebDavPicturesEditor(client);

            pictureEditor.Rotate(decodedTarget, degree);
            DirInfo         targetInfo = client.GetInfo(decodedTarget);
            DirInfo         parentInfo = this.GetParent(targetInfo);
            ChangedResponse response   = new ChangedResponse();

            response.Changed.Add((FileDTO)DTOBase.Create(targetInfo, parentInfo, lroot));
            return(Json(response));
        }
Exemple #7
0
        JsonResult IDriver.Put(string target, string content)
        {
            WebDavRoot lroot = this.GetRoot(target);

            target = this.GetCorectTarget(target);
            string          decodedTarget = this.DecodeTarget(target);
            ChangedResponse answer        = new ChangedResponse();

            client.Upload(decodedTarget, Encoding.Default.GetBytes(content));
            DirInfo targetInfo = client.GetInfo(decodedTarget);

            if (targetInfo == null)
            {
                throw new ElFinderFileNotExists();
            }
            DirInfo parent = this.GetParent(targetInfo);

            answer.Changed.Add((FileDTO)DTOBase.Create(targetInfo, parent, lroot));
            return(Json(answer));
        }