コード例 #1
0
        private string GetSafeThemeName()
        {
            var theme = _themeManager.GetTheme();

            if (string.IsNullOrWhiteSpace(theme))
            {
                return(string.Empty);
            }
            return(theme);
        }
コード例 #2
0
        public static void ApplyTheme(Page page)
        {
            if (page != null)
            {
                var existingTheme = HttpContext.Current.Items["Theme"] as string;
                if (!string.IsNullOrEmpty(existingTheme))
                {
                    page.Theme = existingTheme;
                }
                else
                {
                    page.Theme = _manager != null?_manager.GetTheme(page) : ImageServerConstants.Default;

                    HttpContext.Current.Items["Theme"] = page.Theme;
                }
            }
        }