public static PageTheme GetCompiledInstance(string theme, HttpContext context)
        {
            Type t = ThemeDirectoryCompiler.GetCompiledType(theme, context);

            if (t == null)
            {
                return(null);
            }

            PageTheme pt = (PageTheme)Activator.CreateInstance(t);

            return(pt);
        }
Exemplo n.º 2
0
	void AddStyleSheets (PageTheme theme, ref List <string> links)
	{
		if (theme == null)
			return;

		string[] tmpThemes = theme != null ? theme.GetStyleSheets () : null;
		if (tmpThemes == null || tmpThemes.Length == 0)
			return;

		if (links == null)
			links = new List <string> ();

		links.AddRange (tmpThemes);
	}
Exemplo n.º 3
0
        internal ControlSkin GetControlSkin(Type controlType, string skinID)
        {
            object key = PageTheme.CreateSkinKey(controlType, skinID);

            return(ControlSkins[key] as ControlSkin);
        }
 private void InitializeThemes()
 {
     string theme = this.Theme;
     if (!string.IsNullOrEmpty(theme))
     {
         BuildResultCompiledType themeBuildResultType = ThemeDirectoryCompiler.GetThemeBuildResultType(this.Context, theme);
         if (themeBuildResultType == null)
         {
             throw new HttpException(System.Web.SR.GetString("Page_theme_not_found", new object[] { theme }));
         }
         this._theme = (PageTheme) themeBuildResultType.CreateInstance();
         this._theme.Initialize(this, false);
     }
 }
 internal void InitializeStyleSheet()
 {
     if (!this._pageFlags[1])
     {
         string styleSheetTheme = this.StyleSheetTheme;
         if (!string.IsNullOrEmpty(styleSheetTheme))
         {
             BuildResultCompiledType themeBuildResultType = ThemeDirectoryCompiler.GetThemeBuildResultType(this.Context, styleSheetTheme);
             if (themeBuildResultType == null)
             {
                 throw new HttpException(System.Web.SR.GetString("Page_theme_not_found", new object[] { styleSheetTheme }));
             }
             this._styleSheet = (PageTheme) themeBuildResultType.CreateInstance();
             this._styleSheet.Initialize(this, true);
         }
         this._pageFlags.Set(1);
     }
 }