Orc.NuGetExplorer.NuGetSettings.EnsureSectionExists C# (CSharp) Method

EnsureSectionExists() private method

private EnsureSectionExists ( string section ) : void
section string
return void
        private void EnsureSectionExists(string section)
        {
            Argument.IsNotNullOrWhitespace(() => section);

            var sectionListKey = GetSectionListKey();
            var sectionsString = _configurationService.GetRoamingValue(sectionListKey, string.Empty);
            var sections = sectionsString.Split(new[] {Separator}, StringSplitOptions.RemoveEmptyEntries).ToList();
            if (!sections.Contains(section))
            {
                sections.Add(section);
                sectionsString = string.Join(Separator.ToString(), sections);
                _configurationService.SetRoamingValue(sectionListKey, sectionsString);
            }
        }