public static AppLocation Default() { AppLocation location = new AppLocation(); location.Add(new HiApplication("/", "Common", ApplicationType.Common)); return(location); }
public static AppLocation Create(XmlNode node) { if (node == null) { return(null); } AppLocation location = new AppLocation(); XmlAttributeCollection attributes = node.Attributes; if (attributes != null) { foreach (XmlAttribute attribute in attributes) { if (attribute.Name == "pattern") { location.Pattern = Globals.ApplicationPath + attribute.Value; } else if (attribute.Name == "defaultName") { location.DefaultName = attribute.Value; } } for (int i = 0; i < node.ChildNodes.Count; i++) { XmlNode node2 = node.ChildNodes[i]; if (node2.Name == "add") { XmlAttributeCollection attributes2 = node2.Attributes; if (attributes2 != null) { string pattern = Globals.ApplicationPath + attributes2["pattern"].Value; string name = attributes2["name"].Value; ApplicationType appType = (ApplicationType)Enum.Parse(typeof(ApplicationType), attributes2["type"].Value, true); location.Add(new HiApplication(pattern, name, appType)); } } } } return(location); }