public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) { if (!EnumerableEx.IsNullOrEmpty(ViewDirectors)) { foreach (var director in ViewDirectors.Where(x => x.CanIndirect(controllerContext))) { var result = base.FindPartialView(controllerContext, (director.PartialViewNameBuilder != null ? director.PartialViewNameBuilder(controllerContext, partialViewName) : partialViewName), useCache); if (result != null && result.View != null) { return(result); } } } return(base.FindPartialView(controllerContext, partialViewName, useCache)); }
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { if (!EnumerableEx.IsNullOrEmpty(ViewDirectors)) { foreach (var viewDirector in ViewDirectors.Where(x => x.CanIndirect(controllerContext))) { var result = base.FindView(controllerContext, (viewDirector.ViewNameBuilder != null ? viewDirector.ViewNameBuilder(controllerContext, viewName) : viewName), (viewDirector.MasterNameBuilder != null ? viewDirector.ViewNameBuilder(controllerContext, masterName) : masterName), useCache); if ((result != null) && (result.View != null)) { return(result); } } } return(base.FindView(controllerContext, viewName, masterName, useCache)); }