Пример #1
0
        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);
        }
 private static void Log(object message)
 {
     ThemeLogger.Log(message);
 }