Sources/Domenici.Utilities.Configuration/Configuration/StrongTyper.cs
/// <summary>
/// Load all sections and settings in memory.
/// </summary>
Load all sections and settings in memory.
Load all sections and settings in memory .
private void LoadSettings()
        { 
            long ticks = DateTime.Now.Ticks;
            try
            {
                settingsList = new List<SettingProperties>();
                SettingsLoader loader = new SettingsLoader(settingsList, SettingsManager.SectionSeparator, true, true);
                switch (this.runMode)
                {
                    case RunModes.SingleSourceFile:
                        {
                            Console.WriteLine("Loading application settings data");
                            XmlDocument doc = new XmlDocument();
                            doc.LoadXml(this.settingsFileContents);
                            loader.LoadSettings(doc, true);
                            Console.WriteLine("Done loading application settings data.");
                        }
                        break;
                    case RunModes.MultipleSourceFiles:
                        {
                            foreach (string file in Directory.GetFiles(this.appSettingsFolder, "*.appsettings"))
                            {
                                Console.WriteLine($"Loading application settings data on file: {file}");
                                loader.LoadSettings(file, true);
                                Console.WriteLine($"Done loading application settings data on file: {file}");
                            }
                        }
                        break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                throw new SettingsException("Unexpected error while loading application settings. Please see the inner exception for more details.", e);
            }
        }
private void LoadSettings ( ) { long ticks = DateTime . Now . Ticks ; try { settingsList = new List < SettingProperties > ( ) ; SettingsLoader loader = new SettingsLoader ( settingsList , SettingsManager . SectionSeparator , true , true ) ; switch ( this . runMode ) { case RunModes . SingleSourceFile : { Console . WriteLine ( " " ) ; XmlDocument doc = new XmlDocument ( ) ; doc . LoadXml ( this . settingsFileContents ) ; loader . LoadSettings ( doc , true ) ; Console . WriteLine ( " " ) ; } break ; case RunModes . MultipleSourceFiles : { foreach ( string file in Directory . GetFiles ( this . appSettingsFolder , " " ) ) { Console . WriteLine ( $" Loading application settings data on file:  { file } " ) ; loader . LoadSettings ( file , true ) ; Console . WriteLine ( $" Done loading application settings data on file:  { file } " ) ; } } break ; } } catch ( Exception e ) { Console . WriteLine ( e . ToString ( ) ) ; throw new SettingsException ( " " , e ) ; } }
Load all sections and settings in memory.
Load all sections and settings in memory .
// Load settings file // Load settings file