public string GetLayoutPath(string layoutPath, ViewContext viewContext)
        {
            var layoutName = GuessLayoutName(layoutPath, viewContext.RouteData);
            var viewResult = ViewEngines.Engines.FindPartialView(viewContext.Controller.ControllerContext, layoutName);

            var view = viewResult.View as RazorView;

            if (view == null)
            {
                ThemeLogger.Log(string.Format("Process Layout: {0} => {1}", layoutPath, "EMPTY!"));
                return(string.Empty);
            }

            ThemeLogger.Log(string.Format("Process Layout: {0} => {1}", layoutPath, view.ViewPath));
            return(view.ViewPath);
        }
Пример #2
0
 private static void Log(object message)
 {
     ThemeLogger.Log(message);
 }