Exemplo n.º 1
0
        protected void Initialize(string siteUrlsXmlFile)
        {
            string applicationPath = Globals.ApplicationPath;

            if (applicationPath != null)
            {
                applicationPath = applicationPath.Trim();
            }
            XmlDocument document = this.CreateDoc(siteUrlsXmlFile);

            this.enableHtmRewrite = string.Compare(document.SelectSingleNode("SiteUrls").Attributes["enableHtmRewrite"].Value, "true", true) == 0;
            this.extension        = document.SelectSingleNode("SiteUrls").Attributes["extension"].Value;
            XmlNode basePaths = document.SelectSingleNode("SiteUrls/locations");

            this._locationSet    = this.CreateLocationSet(basePaths, applicationPath);
            this._locationFilter = this._locationSet.Filter;
            ListDictionary transforms = CreateTransformers(document.SelectSingleNode("SiteUrls/transformers"));
            XmlNode        urls       = document.SelectSingleNode("SiteUrls/urls");

            this.CreateUrls(urls, transforms);
        }
Exemplo n.º 2
0
 private 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);
 }
Exemplo n.º 3
0
 protected void Initialize(string siteUrlsXmlFile)
 {
     string applicationPath = Globals.ApplicationPath;
     if (applicationPath != null)
     {
         applicationPath = applicationPath.Trim();
     }
     XmlDocument document = this.CreateDoc(siteUrlsXmlFile);
     this.enableHtmRewrite = string.Compare(document.SelectSingleNode("SiteUrls").Attributes["enableHtmRewrite"].Value, "true", true) == 0;
     this.extension = document.SelectSingleNode("SiteUrls").Attributes["extension"].Value;
     XmlNode basePaths = document.SelectSingleNode("SiteUrls/locations");
     this._locationSet = this.CreateLocationSet(basePaths, applicationPath);
     this._locationFilter = this._locationSet.Filter;
     ListDictionary transforms = CreateTransformers(document.SelectSingleNode("SiteUrls/transformers"));
     XmlNode urls = document.SelectSingleNode("SiteUrls/urls");
     this.CreateUrls(urls, transforms);
 }
Exemplo n.º 4
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;
 }