private void OnWallpaperChanged(string wallpaperFilePath) { if (WallpaperChanged != null) { WallpaperChanged.Invoke(null, new WallpaperChangedEventArgs(wallpaperFilePath)); } }
public void RotatePictureBackward() { try { if (_playlistLast.Any()) { _logger.Debug("Rotating picutre backward"); var nextWallpaper = _playlistLast.Last(); _playlistLast.Remove(nextWallpaper); var oldWallpaper = SetWallpaperAndGetOld(nextWallpaper); if (oldWallpaper != null) { _playlist.Insert(0, oldWallpaper); } } else { _logger.Info("Rotating picutre backward not possible because no wallpaper in playlist available"); } } finally { WallpaperChanged?.Invoke(this, EventArgs.Empty); SetTimer(); } }
public void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, string chPath) { var desktop = pDesktop.ToVirtualDesktop(); desktop._wallpaperPath = chPath; WallpaperChanged?.Invoke(this, new VirtualDesktopWallpaperChangedEventArgs(desktop, chPath)); }
public static void RaiseWallpaperChanged(object sender, VirtualDesktop pDesktop, string path) { var oldPath = pDesktop.WallpaperPath; pDesktop.SetDesktopWallpaperToCache(path); var args = new VirtualDesktopWallpaperChangedEventArgs(pDesktop, oldPath, path); WallpaperChanged?.Invoke(sender, args); }
public void RotatePictureForward() { try { if (_playlist.Any()) { _logger.Debug("Rotating picutre forward"); var nextWallpaper = _playlist.First(); var checkWallpaper = nextWallpaper; while (!checkWallpaper.HasImage) { _playlist.Remove(checkWallpaper); _playlist.Add(checkWallpaper); checkWallpaper = _playlist.First(); if (checkWallpaper == nextWallpaper) { return; } } _playlist.Remove(nextWallpaper); var oldWallpaper = SetWallpaperAndGetOld(nextWallpaper); if (oldWallpaper != null) { _playlistLast.Add(oldWallpaper); } } else { _logger.Info("Rotating picutre forward not possible because no wallpaper in playlist available"); } } finally { WallpaperChanged?.Invoke(this, EventArgs.Empty); SetTimer(); RefreshPlaylist(); } }
/// <summary> /// Fires the "Wallpaper Changed" event. /// </summary> public void FireWallpaperChanged() { WallpaperChanged?.Invoke(); }