Exemplo n.º 1
0
        protected static void SetUpHelpers(IEngineContext engineContext, IController controller, IControllerContext controllerContext)
        {
            var formHelper = new ARFormHelper();

            formHelper.SetContext(engineContext);
            formHelper.SetController(controller, controllerContext);

            var presentationHelper = new PresentationHelper();

            presentationHelper.SetContext(engineContext);
            presentationHelper.SetController(controller, controllerContext);

            var paginationHelper = new PaginationHelper();

            paginationHelper.SetContext(engineContext);
            paginationHelper.SetController(controller, controllerContext);

            var scriptaculous = new ScriptaculousHelper();

            scriptaculous.SetContext(engineContext);
            scriptaculous.SetController(controller, controllerContext);

            var ajaxHelper = new AjaxHelper();

            ajaxHelper.SetContext(engineContext);
            ajaxHelper.SetController(controller, controllerContext);

            controllerContext.Helpers["Scriptaculous"]      = scriptaculous;
            controllerContext.Helpers["Ajax"]               = ajaxHelper;
            controllerContext.Helpers["Form"]               = formHelper;
            controllerContext.Helpers["PresentationHelper"] = presentationHelper;
            controllerContext.Helpers["PaginationHelper"]   = paginationHelper;
        }
Exemplo n.º 2
0
        protected static void SetUpHelpers(Controller controller)
        {
            FormHelper htmlHelper = new FormHelper();

            htmlHelper.SetController(controller);

            ValidationHelper validationHelper = new ValidationHelper();

            validationHelper.SetController(controller);

            PresentationHelper presentationHelper = new PresentationHelper();

            presentationHelper.SetController(controller);

            PaginationHelper paginationHelper = new PaginationHelper();

            paginationHelper.SetController(controller);

            controller.PropertyBag["HtmlHelper"]         = htmlHelper;
            controller.PropertyBag["ValidationHelper"]   = validationHelper;
            controller.PropertyBag["PresentationHelper"] = presentationHelper;
            controller.PropertyBag["PaginationHelper"]   = paginationHelper;
        }