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); }
protected internal override void PackToCore(MsgPack.Packer packer, System.Collections.ObjectModel.Collection <System.DateTime[]> objectTree) { packer.PackArrayHeader(objectTree.Count); System.Collections.Generic.IEnumerator <System.DateTime[]> enumerator = objectTree.GetEnumerator(); System.DateTime[] current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; this._serializer0.PackTo(packer, current); } } finally { enumerator.Dispose(); } }
public Settings RegistryRead(Settings settings) { var settingsInformation = new List <RegistryEntry>(); if (App.IsWindowsMachine) { settingsInformation = (new Settings()).AsEnumerable(SettingsReturnType.Essential).ReadFromRegistry(RegistryRoot, 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)); }