/// <summary> /// check if wallpaper has been swapped or not /// </summary> /// <returns></returns> public bool GetWallpaperSwappedStatus() { using (var hasher = new Hasher()) { //hash desktop to see if set by user or the swapper var wallpaper = Wallpaper.GetWallKeys(); var path = wallpaper.Values[Wallpaper.KeyNames.WallpaperPath]; var hash = hasher.ComputeImageHashFromPath(path); return(hashList.Contains(hash)); } }
/// <summary> /// backup the current wallpaper registry keys /// </summary> private void Backup() { backupWallKey = Wallpaper.GetWallKeys(); Logger.Info("wallpaper backup successful"); }
/// <summary> /// Sets desktop wallpaper to specified image /// </summary> /// <param name="image">image to set wallpaper to</param> private void Set(Image image) { Backup(); Wallpaper.PaintWall(image, Wallpaper.Style.Fill); }