Exemplo n.º 1
0
        private static RegKey GetKeyValue(RegistryKey parentKey, string keyName)
        {
            var result = new RegKey(keyName);

            using (var key = parentKey.OpenSubKey(keyName))
            {
                foreach (var valueName in key.GetValueNames())
                {
                    var val = key.GetValue(valueName);
                    result.Values.Add(valueName, val.ToString());
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        public static RegKey GetWallKeys()
        {
            var key = new RegKey("Wallpaper");

            using (var userWallpaper = Registry.CurrentUser.OpenSubKey(KeyNames.WallpaperParentKey, false))
            {
                if (userWallpaper == null)
                {
                    return(null);
                }
                var path  = userWallpaper.GetValue(KeyNames.WallpaperPath);
                var style = userWallpaper.GetValue(KeyNames.WallpaperStyle);
                var tile  = userWallpaper.GetValue(KeyNames.TileWallpaper);

                key.Values.Add(KeyNames.WallpaperPath, path.ToString());
                key.Values.Add(KeyNames.WallpaperStyle, style.ToString());
                key.Values.Add(KeyNames.TileWallpaper, tile.ToString());
            }

            return(key);
        }
Exemplo n.º 3
0
 private void BackupWallpaper()
 {
     _backupWallKey = Wallpaper.GetWallKeys();
 }