Пример #1
0
        /// <summary>
        /// Rebases all items.
        /// </summary>
        /// <param name="fromUrl"></param>
        /// <param name="toUrl"></param>
        /// <returns></returns>
        /// <remarks>The return enumeration must be enumerated in order for the changes to take effect.</remarks>
        public IEnumerable <RebaseInfo> Rebase(string fromUrl, string toUrl)
        {
            using (var tx = persister.Repository.BeginTransaction())
            {
                foreach (var item in finder.All.Select())
                {
                    bool changed = false;
                    foreach (var info in Rebase(item, fromUrl, toUrl))
                    {
                        changed = true;
                        yield return(info);
                    }
                    if (changed)
                    {
                        persister.Repository.Update(item);
                    }
                }

                ContentItem root = persister.Get(host.DefaultSite.RootItemID);
                root[InstallationManager.InstallationAppPath] = toUrl;
                persister.Repository.Update(root);

                persister.Flush();
                tx.Commit();
            }
        }