public static void RegisterPresenter(Type presenterType) { Type controllerType = PresenterForAttribute.GetControllerType(presenterType); if (controllerType == null) { return; } IEnumerable <PresenterMethod> presenterMethods = PresenterMethod.GetMethods(presenterType); foreach (PresenterMethod presenterMethod in presenterMethods) { RegisterPresenterMethod(presenterMethod, controllerType); } }
private static void RegisterPresenterMethod(PresenterMethod presenterMethod, Type controllerType) { var target = new PresenterTarget(presenterMethod.ViewName, controllerType, presenterMethod.ActionResultType); Presenters.TryAdd(target, presenterMethod); }