예제 #1
0
        internal static Controller RunNoAccessAction(ControllerAction controllerAction)
        {
            WebAppContext.Response.DisableCaching();

            ControllerClass controllerClass = controllerAction.ControllerClass;

            using (Controller controller = controllerClass.CreateController())
            {
                controller.NoAccess(controllerAction);
                return(controller);
            }
        }
예제 #2
0
        internal static Controller RunControllerAction(ControllerAction controllerAction)
        {
            WebAppContext.Response.DisableCaching();

            ControllerClass controllerClass = controllerAction.ControllerClass;

            using (Controller controller = controllerClass.CreateController())
            {
                if (controllerClass.Run(controller, controllerAction.Method))
                {
                    return(controller);
                }
                else
                {
                    return(null);
                }
            }
        }
예제 #3
0
        internal string RenderView(ControllerAction controllerAction)
        {
            string method = _innerView ?? controllerAction.Method;
            Skin   layout = IsAjax() ? null : WebAppHelper.GetLayout(_layoutName);
            Skin   skin   = WebAppHelper.GetSkin(_viewName, method);

            string outerHTML;

            ViewData["SESSION"]  = WebAppContext.Session;
            ViewData["VIEWNAME"] = ViewName;
            ViewData["METHOD"]   = method;
            ViewData["URL"]      = Url;
            ViewData["CUR"]      = Url.Substring(0, Url.LastIndexOf('/'));
            ViewData["SELF"]     = string.Concat(Url, "/", method);

            ViewData["CHECK"] = new Function("Check", WebAppConfig.SecurityProvider);

            ViewData["R"] = ResourceManager.GetResources();

            if (WebAppContext.Request.ApplicationPath != "/")
            {
                ViewData["ROOT"] = WebAppContext.Request.ApplicationPath;
            }
            else
            {
                ViewData["ROOT"] = "";
            }

            ViewData["THEME"]     = WebAppConfig.ThemePath;
            ViewData["EXTENSION"] = WebAppConfig.Extension;

            if (layout == null)
            {
                outerHTML = skin.RenderView(ViewData);
            }
            else
            {
                outerHTML        = skin.RenderView(ViewData);
                ViewData["VIEW"] = outerHTML.TrimStart();
                outerHTML        = layout.RenderView(ViewData);
            }

            return(outerHTML);
        }
예제 #4
0
 internal void NoAccess(ControllerAction controllerAction)
 {
     NoAccess(controllerAction.Method);
 }
예제 #5
0
        internal static Controller RunNoAccessAction(ControllerAction controllerAction)
        {
            WebAppContext.Response.DisableCaching();

            ControllerClass controllerClass = controllerAction.ControllerClass;

            using (Controller controller = controllerClass.CreateController())
            {
                controller.NoAccess(controllerAction);
                return controller;
            }
        }
예제 #6
0
        internal static Controller RunControllerAction(ControllerAction controllerAction)
        {
            WebAppContext.Response.DisableCaching();

            ControllerClass controllerClass = controllerAction.ControllerClass;

            using (Controller controller = controllerClass.CreateController())
            {
                if (controllerClass.Run(controller, controllerAction.Method))
                {
                    return controller;
                }
                else
                {
                    return null;
                }
            }
        }
예제 #7
0
파일: Controller.cs 프로젝트: yslib/minimvc
        internal string RenderView(ControllerAction controllerAction)
        {
            string method = _innerView ?? controllerAction.Method;
            Skin layout = IsAjax() ? null : WebAppHelper.GetLayout(_layoutName);
            Skin skin = WebAppHelper.GetSkin(_viewName, method);

            string outerHTML;

            ViewData["SESSION"] = WebAppContext.Session;
            ViewData["VIEWNAME"] = ViewName;
            ViewData["METHOD"] = method;
            ViewData["URL"] = Url;
            ViewData["CUR"] = Url.Substring(0, Url.LastIndexOf('/'));
            ViewData["SELF"] = string.Concat(Url, "/", method);

            ViewData["CHECK"] = new Function("Check", WebAppConfig.SecurityProvider);

            ViewData["R"] = ResourceManager.GetResources();

            if (WebAppContext.Request.ApplicationPath != "/")
                ViewData["ROOT"] = WebAppContext.Request.ApplicationPath;
            else
                ViewData["ROOT"] = "";

            ViewData["THEME"] = WebAppConfig.ThemePath;
            ViewData["EXTENSION"] = WebAppConfig.Extension;

            if (layout == null)
            {
                outerHTML = skin.RenderView(ViewData);
            }
            else
            {
                outerHTML = skin.RenderView(ViewData);
                ViewData["VIEW"] = outerHTML.TrimStart();
                outerHTML = layout.RenderView(ViewData);
            }

            return outerHTML;
        }
예제 #8
0
파일: Controller.cs 프로젝트: yslib/minimvc
 internal void NoAccess(ControllerAction controllerAction)
 {
     NoAccess(controllerAction.Method);
 }