コード例 #1
0
        private ActionResult CreateResource(string themeName, string container, string file, bool isDirectory,
            string contents, bool rewriteFile = false)
        {
            try
            {
                var resource = new ResourceCreator
                {
                    ThemeName = themeName,
                    Container = container,
                    File = file,
                    IsDirectory = isDirectory,
                    Contents = contents,
                    Rewrite = rewriteFile
                };

                resource.Create();
            }
            catch (ResourceCreateException ex)
            {
                return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError);
            }

            return Json(new {success = true}, JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
ファイル: ThemeController.cs プロジェクト: frapid/frapid
        private ActionResult CreateResource(string themeName, string container, string file, bool isDirectory, string contents, bool rewriteFile = false)
        {
            try
            {
                var resource = new ResourceCreator
                               {
                                   ThemeName = themeName,
                                   Container = container,
                                   File = file,
                                   IsDirectory = isDirectory,
                                   Contents = contents,
                                   Rewrite = rewriteFile
                               };

                resource.Create(this.Tenant);
            }
            catch(ResourceCreateException ex)
            {
                return this.Failed(ex.Message, HttpStatusCode.InternalServerError);
            }

            return this.Ok();
        }