/// <summary>
        /// This static method clears all resources from the loaded Resource Providers
        /// and forces them to be reloaded the next time they are requested.
        ///
        /// Use this method after you've edited resources in the database and you want
        /// to refresh the UI to show the newly changed values.
        ///
        /// This method works by internally tracking all the loaded ResourceProvider
        /// instances and calling the IwwResourceProvider.ClearResourceCache() method
        /// on each of the provider instances. This method is called by the Resource
        /// Administration form when you explicitly click the Reload Resources button.
        /// <seealso>Class DbResourceConfiguration</seealso>
        /// </summary>
        public void ClearResourceCache()
        {
            OnResourcesReloaded?.Invoke();

            // clear any resource managers
            DbRes.ClearResources();
        }
Esempio n. 2
0
 protected void Application_BeginRequest(object sender, EventArgs e)
 {
     this.Response.Headers["X-Content-Type-Options"] = "nosniff";
     ResourcesReloadEnabled = SettingRepository.Get <string>("ResourcesReloadEnabled");
     if (!string.IsNullOrEmpty(ResourcesReloadEnabled) && ResourcesReloadEnabled.Equals("true"))
     {
         DbRes.ClearResources();
     }
 }
 public void ReloadResources()
 {
     //Westwind.Globalization.Tools.wwWebUtils.RestartWebApplication();
     DbResourceConfiguration.ClearResourceCache(); // resource provider
     DbRes.ClearResources();                       // resource manager
 }