Ejemplo n.º 1
0
        /// <summary>
        /// Class factory to create a Theme object with the specified name. skinDir
        /// directory contains all the assets for the Theme. Skinfile is the xml
        /// file that contains references to all the theme assets.
        /// </summary>
        /// <param name="themeName">Name of the theme</param>
        /// <param name="skinDir">directory where theme assets are located</param>
        /// <param name="themeFile">name of the theme config file</param>
        /// <returns></returns>
        public static Theme Create(String themeName, String skinDir, String themeFile)
        {
            Theme theme = null;

            if (!File.Exists(themeFile))
            {
                return(null);
            }

            try
            {
                var doc = new XmlDocument();

                doc.Load(themeFile);

                // create the colorschemes object by parsing the colorschemes nodes
                var colorSchemesNode = doc.SelectSingleNode("/ACAT/Skin/ColorSchemes");
                if (colorSchemesNode != null)
                {
                    theme = new Theme(themeName)
                    {
                        Colors = ColorSchemes.Create(colorSchemesNode, skinDir)
                    };
                }
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
            }

            return(theme);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses the xml node and creates a color scheme object form it. The
        /// theme dir path contains the assets for the color scheme
        /// </summary>
        /// <param name="node">the xml node</param>
        /// <param name="themeDir">path to the assets</param>
        /// <returns>Color scheme collection</returns>
        public static ColorSchemes Create(XmlNode node, String themeDir)
        {
            var colorSchemes = new ColorSchemes();

            colorSchemes.loadAndAddColorScheme(node, themeDir);

            return(colorSchemes);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parses the xml node and creates a color scheme object form it. The
        /// skin dir path contains the assets for the color scheme
        /// </summary>
        /// <param name="node">the xml node</param>
        /// <param name="skinDir">path to the assets</param>
        /// <returns>Color scheme collection</returns>
        public static ColorSchemes Create(XmlNode node, String skinDir)
        {
            var colorSchemes = new ColorSchemes();
            colorSchemes.loadAndAddColorScheme(node, skinDir);

            return colorSchemes;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 /// <param name="name">Name of the color scheme</param>
 private Theme(String name)
 {
     Name   = name;
     Colors = new ColorSchemes();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 /// <param name="name">Name of the color scheme</param>
 private Theme(String name)
 {
     Name = name;
     Colors = new ColorSchemes();
 }