Exemplo n.º 1
0
        // rebuild the index...
        public void ClearLog(string[] storenames)
        {
            bool published        = this.WebSite.Published;
            bool disksync         = this.WebSite.EnableDiskSync;
            bool continuedownload = this.WebSite.ContinueDownload;

            this.WebSite.Published        = false;
            this.WebSite.EnableDiskSync   = false;
            this.WebSite.ContinueDownload = false;

            ImagePool.ClearAll();
            this.DatabaseDb.Close();

            foreach (var item in storenames)
            {
                if (Lib.Helper.StringHelper.IsSameValue(item, Images.StoreName))
                {
                    ImagePool.ClearAll();
                    Images.Store.Close();
                }

                var repo = this.GetRepository(item);
                if (repo != null && repo is ISiteRepositoryBase)
                {
                    var siterepo = repo as ISiteRepositoryBase;


                    Monitor.Enter(_repolocker);

                    try
                    {
                        siterepo.Reuild();
                    }
                    catch (Exception)
                    {
                    }
                    finally
                    {
                        Monitor.Exit(_repolocker);
                    }
                }
            }

            this.WebSite.Published        = published;
            this.WebSite.EnableDiskSync   = disksync;
            this.WebSite.ContinueDownload = continuedownload;
        }