Exemple #1
0
        static ChoEnvironmentSettings()
        {
            ChoConfigurationManager.Refresh();
            _appConfigFileWatcher = new ChoConfigurationChangeFileWatcher("AppConfigFileWatcher", ChoConfigurationManager.ApplicationConfigurationFilePath);
            _appConfigFileWatcher.DoNotUseGlobalQueue = true;

            _appConfigFileWatcher.SetConfigurationChangedEventHandler("OnEnvironmentChanged", (sender, e) =>
            {
                // ChoAppFrxSettings.RefreshSection();
                //ChoCommandLineParserSettings.RefreshSection();
                CheckNChangeEnvironment();
            });

            if (ChoApplication.OnInitialize != null)
            {
                ChoApplication.OnInitialize(ChoAppFrxSettings.Me);
            }

            Environment = ChoAppFrxSettings.Me.AppEnvironment.NTrim();
            _sharedEnvironmentConfigFilePath = ChoSharedEnvironmentManager.SharedEnvironmentConfigFilePath;
            _appFrxFilePath = ChoSharedEnvironmentManager.AppFrxFilePath;

            LoadSharedEnvironmentManager();
            _appConfigFileWatcher.StartWatching();
        }