示例#1
0
 /// <summary>
 /// Forces a refresh/reload of the <see cref="ILocalization"/> and its associated configuration.
 /// </summary>
 public virtual void Refresh(bool allSiteLocalizations = false)
 {
     using (new Tracer(allSiteLocalizations, this))
     {
         if (allSiteLocalizations)
         {
             // Refresh all Site Localizations (variants)
             foreach (ILocalization localization in SiteLocalizations)
             {
                 try
                 {
                     localization.Refresh();
                 }
                 catch (Exception ex)
                 {
                     // Localization may not be published (yet). Log the exception and continue.
                     Log.Error(ex);
                 }
             }
         }
         else
         {
             // Refresh only this Localization
             _resourceManager.Reload();
             _mappingsManager.Reload();
             Load();
         }
     }
 }
 /// <summary>
 /// Forces a refresh/reload of the <see cref="ILocalization"/> and its associated configuration.
 /// </summary>
 public virtual void Refresh(bool allSiteLocalizations = false)
 {
     using (new Tracer(allSiteLocalizations, this))
     {
         if (allSiteLocalizations)
         {
             // Refresh all Site Localizations (variants)
             if (SiteLocalizations == null)
             {
                 return;
             }
             foreach (Localization localization in SiteLocalizations)
             {
                 try
                 {
                     localization.Refresh();
                 }
                 catch (Exception ex)
                 {
                     // Localization may not be published (yet). Log the exception and continue.
                     Log.Error(ex);
                 }
             }
         }
         else
         {
             // Refresh only this Localization
             try
             {
                 _resourceManager.Reload();
                 _mappingsManager.Reload();
                 Load();
             }
             catch (Exception)
             {
                 // If an exception occurs during Loading, the Localization should remain uninitialized.
                 LastRefresh = DateTime.MinValue;
                 throw;
             }
         }
     }
 }