public Settings RegistryRead (Settings settings) { var settingsInformation = new List<RegistryEntry>(); if (App.IsWindowsMachine) settingsInformation = (new Settings()).AsEnumerable(SettingsReturnType.Essential).ReadFromRegistry(registryRootValue, App.IsDebugging).ToList(); else { var settingsFromFile = new System.Collections.ObjectModel.Collection<string>().AddFileContents(RegistryFile); if(settingsFromFile.Any()) { for (var position = settingsFromFile.GetEnumerator(); position.MoveNext();) { var entry = position.Current.Split(new[] { RegistryEntry.Separator }, StringSplitOptions.RemoveEmptyEntries); settingsInformation.Add(new RegistryEntry(entry.First(), entry.Last())); } } } return settings.Replace(settingsInformation); }
public Download(IStorage storage) { this.settingsStore = storage.RegistryRead(new Settings()); }