コード例 #1
0
        public ActionResult Edit(EditContentTypeViewModel viewModel)
        {
            //TODO: Validation, etc.
            //TODO: BaseContentType

            var module = _reflectionContentManager.LoadModule(viewModel.ModuleName);

            module.AddContentType(viewModel.Name);

            _reflectionContentManager.Store(module);
            _reflectionContentManager.SaveChanges();

            return(Redirect("/admin/module?modulename=" + viewModel.ModuleName));
        }
コード例 #2
0
        public ActionResult Delete(string propertyFullName)
        {
            var contentTypeFullName = _reflectionContentManager.GetContentTypeFullNameFromPropertyFullName(propertyFullName);
            var contentType         = _reflectionContentManager.LoadContentType(contentTypeFullName);

            if (contentType != null)
            {
                if (contentType.RemoveProperty(propertyFullName))
                {
                    _reflectionContentManager.Store(contentType.Module);
                    _reflectionContentManager.SaveChanges();
                }

                return(Redirect(new StringBuilder("/admin/contenttype")
                                .AddQueryParam("contenttypefullname", contentTypeFullName).ToString()));
            }

            return(Redirect("/admin/modules"));
        }
コード例 #3
0
 public void SaveChanges()
 {
     _reflectionContentManager.SaveChanges();
 }