Exemplo n.º 1
0
        /// <summary>
        /// Load all hotspots for the skin
        /// </summary>
        /// <param name="xmlNode"></param>
        /// <returns></returns>
        internal ArrayList      LoadControls(XmlNode xmlNode)
        {
            ArrayList mControls = new ArrayList();

            foreach (XmlNode node in xmlNode.ChildNodes)
            {
                if (node.Name == @"#comment")
                {
                    continue;
                }
                SkinBaseControl skinControl = (SkinBaseControl)LoadElement(node);
                if (skinControl == null)
                {
                    continue;
                }
                if (node.ChildNodes.Count != 0)
                {
                    FormSkin skin = new FormSkin();
                    skin.ResDir = ResDir;
                    foreach (XmlNode cnode in node.ChildNodes)
                    {
                        if (cnode.Name == "window" && skin.Load(cnode))
                        {
                            skinControl.Skin = skin;
                            break;
                        }
                    }
                }
                else
                {
                    foreach (XmlAttribute attr in node.Attributes)
                    {
                        if (attr.Name == @"file")
                        {
                            FormSkin skin = new FormSkin();
                            skin.ResDir = ResDir;
                            try
                            {
                                if (skin.Load(ResDir + @"\", attr.Value))
                                {
                                    skinControl.Skin = skin;
                                    break;
                                }
                            }
                            catch (Exception)
                            {
                                break;
                            }
                        }
                    }
                }
                mControls.Add(skinControl);
            }
            return(mControls);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Path to directory with skin files
        /// </summary>
        private bool SetSkinFromFile(string fullPath)
        {
            FormSkin skin = new FormSkin();

            if (skin.Load(fullPath))
            {
                Skin = skin;
                return(true);
            }
            else
            {
                Skin = null;
            }
            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Load included skin
        /// </summary>
        /// <param name="xmlNode"></param>
        /// <returns></returns>
        internal void   LoadInclude(XmlNode xmlNode)
        {
            FormSkin includeSkin = new FormSkin();

            foreach (XmlAttribute node in xmlNode.Attributes)
            {
                if (node.Name == @"file")
                {
                    try
                    {
                        if (includeSkin.Load(ResDir + @"\", node.Value))
                        {
                            subSkins.Add(includeSkin);
                            return;
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }