public static Skin CreateFromXmlNode(XmlNode node) { Skin s = new Skin(); if(node.SelectSingleNode("/Skin/Name") != null) s.Name = node.SelectSingleNode("/Skin/Name").InnerText; if(node.SelectSingleNode("/Skin/Author") != null) s.Author = node.SelectSingleNode("/Skin/Author").InnerText; if(node.SelectSingleNode("/Skin/Version") != null) s.Version = node.SelectSingleNode("/Skin/Version").InnerText; if(node.SelectSingleNode("/Skin/Description") != null) s.Description = node.SelectSingleNode("/Skin/Description").InnerText; if (node.SelectSingleNode("/Skin/AllowedRootTemplate") != null) s.AllowedRootTemplate = node.SelectSingleNode("/Skin/AllowedRootTemplate").InnerText; foreach (XmlNode depNode in node.SelectNodes("/Skin//Dependency")) { try { s.Dependencies.Add(Dependency.CreateFromXmlNode(depNode)); } catch (Exception ex) { umbraco.BusinessLogic.Log.Add(BusinessLogic.LogTypes.Error, 0, "Failed to load dependency type " + (depNode.Attributes["type"] != null ? depNode.Attributes["type"].Value : string.Empty) + ex.Message); } } if (node.SelectSingleNode("/Skin/CSS") != null) s.Css = EmbeddedCss.CreateFromXmlNode(node.SelectSingleNode("/Skin/CSS")); return s; }
public static void ActivateAsCurrentSkin(Skin skin) { Template t = Template.GetByAlias(skin.AllowedRootTemplate); ActivateAsCurrentSkin(t.Id, skin.Alias); }