public ThemedRazorViewEngine(Theme theme)
        {
            _theme = theme;

            base.ViewLocationFormats = new[]
            {
                _theme.Path + "/Views/{1}/{0}.cshtml",
                _theme.Path + "/Views/Shared/{0}.cshtml",
                "~/Themes/Default/Views/{1}/{0}.cshtml"
            };

            base.PartialViewLocationFormats = new[]
            {
                _theme.Path + "/Views/{1}/{0}.cshtml",
                _theme.Path + "/Views/Shared/{0}.cshtml",
                "~/Themes/Default/Views/Shared/{0}.cshtml"
            };

            base.AreaViewLocationFormats = new[]
            {
                _theme.Path + "/Views/{2}/{1}/{0}.cshtml",
                _theme.Path + "/Views/Shared/{0}.cshtml",
                "~/Themes/Default/Views/{1}/{0}.cshtml"
            };
            base.AreaPartialViewLocationFormats = new[]
            {
                _theme.Path + "/Views/{2}/{1}/{0}.cshtml",
                _theme.Path + "/Views/{1}/{0}.cshtml",
                _theme.Path + "/Views/Shared/{0}.cshtml",
                "~/Themes/Default/Views/Shared/{0}.cshtml"
            };
        }
        public static void RegisterViewEngine(ViewEngineCollection viewEngines)
        {
            // We do not need the default view engine

            viewEngines.Clear();

            var basePath = ConfigurationManager.AppSettings["ThemeBasePath"];
            var themeName = ConfigurationManager.AppSettings["ThemeName"];

            var theme = new Theme(basePath,themeName);

            var themeableRazorViewEngine = new ThemedRazorViewEngine(theme);

            viewEngines.Add(themeableRazorViewEngine);
        }