예제 #1
0
 public void Add(string name, Location location)
 {
     if (null != name)
     {
         this.locations[name.ToLower(CultureInfo.InvariantCulture)] = location;
     }
 }
예제 #2
0
 Hidistro.Core.Urls.LocationSet CreateLocationSet(XmlNode basePaths, string globalPath)
 {
     Hidistro.Core.Urls.LocationSet set = new Hidistro.Core.Urls.LocationSet();
     foreach (XmlNode node in basePaths.ChildNodes)
     {
         if (node.NodeType != XmlNodeType.Comment)
         {
             XmlAttribute attribute = node.Attributes["name"];
             XmlAttribute attribute2 = node.Attributes["path"];
             XmlAttribute attribute3 = node.Attributes["physicalPath"];
             XmlAttribute attribute4 = node.Attributes["exclude"];
             XmlAttribute attribute5 = node.Attributes["type"];
             if ((attribute != null) && (attribute2 != null))
             {
                 string physicalPath = null;
                 if (attribute3 != null)
                 {
                     physicalPath = globalPath + attribute3.Value;
                 }
                 bool exclude = (attribute4 != null) && bool.Parse(attribute4.Value);
                 Location location = null;
                 string path = globalPath + attribute2.Value;
                 if (attribute5 == null)
                 {
                     location = new Location(path, physicalPath, exclude);
                 }
                 else
                 {
                     location = Activator.CreateInstance(Type.GetType(attribute5.Value), new object[] { path, physicalPath, exclude }) as Location;
                 }
                 set.Add(attribute.Value, location);
             }
         }
     }
     return set;
 }