Ejemplo n.º 1
0
        /// <summary>
        /// Changes the theme to the newly selected theme
        /// </summary>
        /// <param name="newTheme"></param>
        public static void ChangeTheme(Theme newTheme)
        {
            if (newTheme == null)
                throw new ArgumentNullException("newTheme");

            if (_currentTheme != null)
            {
                _currentTheme.Unload();
            }

            newTheme.Load();
            _currentTheme = newTheme;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Will load the themes from the Skins directory
        /// </summary>
        private static void LoadAvailableThemes()
        {
            if (_availableThemes == null)
            {
                _availableThemes = new List<Theme>();

                //Look for assemblies in the appropriate directory
                string[] skinAssemblies = Directory.GetFiles(ThemeDirectory, ThemeFileFilter);
                foreach (string skinAssembly in skinAssemblies)
                {
                    string themeName = GetThemeName(skinAssembly);
                    Theme theme = new Theme(themeName, skinAssembly);
                    _availableThemes.Add(theme);
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Clears the current theme from the application
 /// </summary>
 public static void ClearTheme()
 {
     if (_currentTheme != null)
     {
         _currentTheme.Unload();
         _currentTheme = null;
     }
 }