Example #1
0
        private void AddSite(HostSection hostSection, SiteElement element)
        {
            Site site = new Site(hostSection.RootItemID, element.StartPageID, element.SiteHosts);
            site.Wildcards = hostSection.Wildcards || element.Wildcards;
            _sites.Add(site);

            if (element.SiteHosts == null || element.SiteHosts.Count == 0)
                SetFallbackSettings(site);
            else
                foreach (HostNameElement hostName in element.SiteHosts)
                {
                    if (_hostToSites.ContainsKey(hostName.Name))
                        throw new ConfigurationErrorsException("A host name can occur only once. " + hostName.Name + "in <siteHosts> has already been defined.");

                    if (hostName.Name == "*")
                        SetFallbackSettings(site);
                    else
                        _hostToSites.Add(hostName.Name, site);
                }
        }
Example #2
0
 public void Add(SiteElement site)
 {
     BaseAdd(site);
 }