Exemplo n.º 1
0
        /// <summary>Adds sites to the available sites.</summary>
        /// <param name="additionalSites">Sites to add.</param>
        public void AddSites(IEnumerable <Site> additionalSites)
        {
            var previous = sites;

            sites = previous.Add(additionalSites);

            var args = new SitesChangedEventArgs();

            args.PreviousDefault = previous.DefaultSite;
            args.PreviousSites   = previous.Sites;
            args.CurrentDefault  = sites.DefaultSite;
            args.CurrentSites    = sites.Sites;

            if (SitesChanged != null)
            {
                SitesChanged.Invoke(this, args);
            }
        }
Exemplo n.º 2
0
        /// <summary>Replaces the site list with new sites.</summary>
        /// <param name="newDefaultSite">The default site to use.</param>
        /// <param name="newSites">The new site list.</param>
        public void ReplaceSites(Site newDefaultSite, IEnumerable <Site> newSites)
        {
            if (newSites == null)
            {
                throw new ArgumentNullException("newSites");
            }

            var previous = sites;

            sites = new SiteTable(newDefaultSite, newSites);

            var args = new SitesChangedEventArgs();

            args.PreviousDefault = previous.DefaultSite;
            args.PreviousSites   = previous.Sites;
            args.CurrentDefault  = sites.DefaultSite;
            args.CurrentSites    = sites.Sites;

            if (SitesChanged != null)
            {
                SitesChanged.Invoke(this, args);
            }
        }