Esempio n. 1
0
        public Func <object, object> GetPresenter(string viewName, Type controllerType, Type actionResultType)
        {
            var             currentTarget = new PresenterTarget(viewName, controllerType, actionResultType);
            PresenterMethod presenterMethod;

            if (Presenters.TryGetValue(currentTarget, out presenterMethod))
            {
                return(viewResult => presenterMethod.Invoke(viewResult, _presenterActivator));
            }
            return(IdentityPresenter);
        }
Esempio n. 2
0
        private static void RegisterPresenterMethod(PresenterMethod presenterMethod, Type controllerType)
        {
            var target = new PresenterTarget(presenterMethod.ViewName, controllerType, presenterMethod.ActionResultType);

            Presenters.TryAdd(target, presenterMethod);
        }