public MultipleSitesInitializer(IPersister persister, IHost host, ISitesProvider sitesProvider, HostSection config, IDefinitionManager ignored)
        {
            Debug.WriteLine("MultipleSitesInitializer");

            if (config.MultipleSites && config.DynamicSites)
            {
                host.AddSites(sitesProvider.GetSites());
                persister.ItemSaved += delegate(object sender, ItemEventArgs e)
                {
                    if (e.AffectedItem is ISitesSource)
                    {
                        IList<Site> sites = Host.ExtractSites(config);
                        sites = Host.Union(sites, sitesProvider.GetSites());

                        host.ReplaceSites(host.DefaultSite, sites);
                    }
                };
            }
        }
        public MultipleSitesInitializer(IPersister persister, IHost host, ISitesProvider sitesProvider, HostSection config, IDefinitionManager ignored)
        {
            Debug.WriteLine("MultipleSitesInitializer");

            if (config.MultipleSites && config.DynamicSites)
            {
                host.AddSites(sitesProvider.GetSites());
                persister.ItemSaved += delegate(object sender, ItemEventArgs e)
                {
                    if (e.AffectedItem is ISitesSource)
                    {
                        IList <Site> sites = Host.ExtractSites(config);
                        sites = Host.Union(sites, sitesProvider.GetSites());

                        host.ReplaceSites(host.DefaultSite, sites);
                    }
                };
            }
        }
        public MultipleSitesParser(IPersister persister, IWebContext webContext, IHost host, ISitesProvider sitesProvider, HostSection config)
            : base(persister, webContext, host, config)
        {
            if (config == null) throw new ArgumentNullException("config");

            if (config.DynamicSites)
            {
                host.AddSites(sitesProvider.GetSites());
                persister.ItemSaved += delegate(object sender, ItemEventArgs e)
                {
                    if(e.AffectedItem is ISitesSource)
                    {
                        IList<Site> sites = Host.ExtractSites(config);
                        sites = Host.Union(sites, sitesProvider.GetSites());

                        host.ReplaceSites(host.DefaultSite, sites);
                    }
                };
            }
        }
Beispiel #4
0
        public MultipleSitesParser(IPersister persister, IWebContext webContext, IHost host, ISitesProvider sitesProvider, HostSection config)
            : base(persister, webContext, host, config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (config.DynamicSites)
            {
                host.AddSites(sitesProvider.GetSites());
                persister.ItemSaved += delegate(object sender, ItemEventArgs e)
                {
                    if (e.AffectedItem is ISitesSource)
                    {
                        IList <Site> sites = Host.ExtractSites(config);
                        sites = Host.Union(sites, sitesProvider.GetSites());

                        host.ReplaceSites(host.DefaultSite, sites);
                    }
                };
            }
        }