Exemplo n.º 1
0
        public ActionResult GetDrives(string path = "")
        {
            List <FolderTreeViewModel> drives;

            try
            {
                drives = driveService.GetDrives().Select(d => d.ToFolderTreeViewModel()).ToList();
            }
            catch (UnauthorizedAccessException e)
            {
                return(Json(new { Status = "NotAcceptable" }, JsonRequestBehavior.AllowGet));
            }

            if (Request.IsAjaxRequest())
            {
                return(PartialView("GetDrivesTree", drives));
            }
            return(View(drives));
        }