Microsoft.R.Components.Application.Configuration.ConfigurationSettingsReader.LoadSettings C# (CSharp) Method

LoadSettings() public method

public LoadSettings ( ) : IReadOnlyList
return IReadOnlyList
        public IReadOnlyList<IConfigurationSetting> LoadSettings() {
            var settings = new List<IConfigurationSetting>();
            var cp = new ConfigurationParser(_reader);
            while (true) {
                var s = cp.ReadSetting();
                if (s == null) {
                    break;
                }
                settings.Add(s);
            }
            return settings;
        }
    }

Usage Example

 /// <summary>
 /// Loads settings from the file
 /// </summary>
 public void Load(string filePath)
 {
     lock (_lock) {
         try {
             Clear();
             using (var sr = new StreamReader(filePath)) {
                 using (var csr = new ConfigurationSettingsReader(sr)) {
                     var settings = csr.LoadSettings();
                     foreach (var s in settings)
                     {
                         Add(s);
                     }
                 }
             }
             SourceFile = filePath;
         } catch (IOException) {
             SourceFile = null;
         } catch (UnauthorizedAccessException) {
             SourceFile = null;
         }
     }
 }
All Usage Examples Of Microsoft.R.Components.Application.Configuration.ConfigurationSettingsReader::LoadSettings