private static void SetWallpaper(Theme newTheme, RuntimeConfig rtc, List <string> darkThemeWallpapers, List <string> lightThemeWallpapers, bool enabled) { if (enabled) { if (newTheme == Theme.Dark) { var success = WallpaperHandler.SetBackground(darkThemeWallpapers); if (success) { rtc.CurrentWallpaperTheme = newTheme; rtc.CurrentWallpaperPath = WallpaperHandler.GetBackground(); } } else { var success = WallpaperHandler.SetBackground(lightThemeWallpapers); if (success) { rtc.CurrentWallpaperTheme = newTheme; rtc.CurrentWallpaperPath = WallpaperHandler.GetBackground(); } } } }
private static void SetWallpaper(Theme newTheme, GlobalState rtc, List <string> darkThemeWallpapers, List <string> lightThemeWallpapers, bool enabled) { if (enabled) { try { if (newTheme == Theme.Dark) { var success = WallpaperHandler.SetBackground(darkThemeWallpapers); if (success) { rtc.CurrentWallpaperTheme = newTheme; rtc.CurrentWallpaperPath = WallpaperHandler.GetBackground(); } } else { var success = WallpaperHandler.SetBackground(lightThemeWallpapers); if (success) { rtc.CurrentWallpaperTheme = newTheme; rtc.CurrentWallpaperPath = WallpaperHandler.GetBackground(); } } } catch (Exception ex) { Logger.Error(ex, "could not set wallpaper"); } } }