Exemplo n.º 1
0
 public static Theme FindTheme(string themeName, bool fallbackToControlDefault)
 {
     lock (ThemeRepository.lockObject)
     {
         if (string.IsNullOrEmpty(themeName) || themeName == "ControlDefault")
         {
             return(ThemeRepository.ControlDefault);
         }
         if (ThemeRepository.themes.Contains((object)themeName))
         {
             return((Theme)ThemeRepository.themes[(object)themeName]);
         }
         if (ThemeRepository.registeredThemes.Contains((object)themeName))
         {
             RadThemeComponentBase registeredTheme = (RadThemeComponentBase)ThemeRepository.registeredThemes[(object)themeName];
             ThemeRepository.registeredThemes.Remove((object)themeName);
             registeredTheme.Load();
             if (registeredTheme.Site == null && !registeredTheme.IsDesignMode)
             {
                 registeredTheme.Dispose();
             }
             return(ThemeRepository.FindTheme(themeName, fallbackToControlDefault));
         }
         if (fallbackToControlDefault)
         {
             return(ThemeRepository.ControlDefault);
         }
     }
     return((Theme)null);
 }
Exemplo n.º 2
0
 public static void RegisterTheme(RadThemeComponentBase theme)
 {
     lock (ThemeRepository.lockObject)
     {
         if (ThemeRepository.registeredThemes.Contains((object)theme.ThemeName))
         {
             return;
         }
         ThemeRepository.registeredThemes.Add((object)theme.ThemeName, (object)theme);
     }
 }