using System; using System.Collections.Generic; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Set the text to look for when building the list of Wallpaper Profiles to pick from string wallpaperSeason = "Winter"; // Build the list of Wallpaper Profiles that match the text List<string> wallpaperProfilePool = new List<string>(); foreach (string profile in BFS.DisplayFusion.GetWallpaperProfiles()) { if (profile.ToLower().Contains(wallpaperSeason.ToLower())) { wallpaperProfilePool.Add(profile); } } // Select a random profile from the list Random randomNumber = new Random(); string selectedRandomWallpaperProfile = wallpaperProfilePool[randomNumber.Next(0,wallpaperProfilePool.Count - 1)]; BFS.DisplayFusion.LoadWallpaperProfile(selectedRandomWallpaperProfile); } }