Storage of the R application settings. Settings are written into R file as assignment statements such as 'name <- value'. Value can be string or an expression. The difference is that string values are quoted when written into the file and expressions are written as is.
Inheritance: IConfigurationSettingsWriter
 /// <summary>
 /// Writes settings to a disk file.
 /// </summary>
 public void Save(string filePath = null)
 {
     lock (_lock) {
         SourceFile = filePath ?? SourceFile;
         if (SourceFile == null)
         {
             throw new InvalidOperationException("Either settings must have been previously loaded from the existing file or a file name must be provided");
         }
         if (Count > 0)
         {
             using (var sw = new StreamWriter(SourceFile)) {
                 using (var csw = new ConfigurationSettingsWriter(sw)) {
                     csw.SaveSettings(this);
                 }
             }
         }
     }
 }
        private void LoadAndWrite(string originalContent, string expectedContent) {
            IReadOnlyList<IConfigurationSetting> settings;
            var sr = new StreamReader(ToStream(originalContent));
            using (var csr = new ConfigurationSettingsReader(sr)) {
                settings = csr.LoadSettings();
            }

            var stream = new MemoryStream();
            using (var csw = new ConfigurationSettingsWriter(new StreamWriter(stream))) {
                csw.SaveSettings(settings);

                stream.Seek(0, SeekOrigin.Begin);
                using (var r = new StreamReader(stream)) {
                    var s = r.ReadToEnd();
                    s.Should().StartWith(Resources.SettingsFileHeader);
                    s.Should().Contain(expectedContent);
                }
            }
        }