public SettingsPageViewModel(IConfigurationSettingCollection settings, ICoreShell coreShell, IFileSystem fileSystem) { Check.ArgumentNull(nameof(settings), settings); Check.ArgumentNull(nameof(coreShell), coreShell); Check.ArgumentNull(nameof(fileSystem), fileSystem); _settings = settings; _coreShell = coreShell; _fileSystem = fileSystem; }
public SettingsPageViewModel(IConfigurationSettingCollection settings, ICoreShell coreShell, IFileSystem fileSystem) { Check.ArgumentNull(nameof(settings), settings); Check.ArgumentNull(nameof(coreShell), coreShell); Check.ArgumentNull(nameof(fileSystem), fileSystem); _settings = settings; _coreShell = coreShell; _fileSystem = fileSystem; }
public static string FindNextAvailableSettingName(this IConfigurationSettingCollection settings, string nameTemplate) { var names = new HashSet <string>(); var existingNames = settings.Where(s => s.Name.StartsWithOrdinal(nameTemplate)).Select(s => s.Name); foreach (var n in existingNames) { names.Add(n); } if (names.Count > 0) { for (int i = 1; i < 1000; i++) { var candidate = nameTemplate + i.ToString(CultureInfo.InvariantCulture); if (!names.Contains(candidate)) { return(candidate); } } } return(nameTemplate); }
public SettingsTypeDescriptor(ICoreShell coreShell, IConfigurationSettingCollection settings) { _coreShell = coreShell; _settings = settings; }
public SettingsTypeDescriptor(ICoreShell coreShell, IConfigurationSettingCollection settings) { _coreShell = coreShell; _settings = settings; }