// <summary> /// Change all screens /// </summary> public void NextSameTime() { try { Screen[] screens = Screen.AllScreens; Dictionary <string, DesktopImage> images = new Dictionary <string, DesktopImage>(screens.Length); for (int i = 0; i < screens.Length; i++) { Screen screen = screens[i]; if (OrderMode == OrderModes.Random) { images[screen.DeviceName] = new DesktopImage(ImageList.NextRandom(screen.DeviceName)); } else { images[screen.DeviceName] = new DesktopImage(ImageList.Next(screen.DeviceName)); } } Wallpaper.CreateBackgroundImage(images, _controlerForms); } catch (MissingImagesException) { Wallpaper.CreateTestBackgroundImage(); } }
public void Previous() { Screen[] screens = Screen.AllScreens; Dictionary <string, DesktopImage> images = new Dictionary <string, DesktopImage>(screens.Length); // do in reverse order to keep multimonitors in sync for (int i = screens.Length - 1; i >= 0; i--) { Screen screen = screens[i]; images[screen.DeviceName] = new DesktopImage(ImageList.Previous(screen.DeviceName)); } Wallpaper.CreateBackgroundImage(images, _controlerForms); }
private void NextAlternately() { try { Screen[] screens = Screen.AllScreens; Dictionary <string, DesktopImage> images = new Dictionary <string, DesktopImage>(screens.Length); for (int i = 0; i < screens.Length; i++) { Screen screen = screens[i]; if (i == NextAlternatelyCount) { if (OrderMode == OrderModes.Random) { images[screen.DeviceName] = new DesktopImage(ImageList.NextRandom(screen.DeviceName)); } else { images[screen.DeviceName] = new DesktopImage(ImageList.Next(screen.DeviceName)); } } else { images[screen.DeviceName] = new DesktopImage(ImageList.Current(screen.DeviceName)); } } Wallpaper.CreateBackgroundImage(images, _controlerForms); // next wallpaper NextAlternatelyCount++; if (NextAlternatelyCount >= screens.Length) { NextAlternatelyCount = 0; } } catch (MissingImagesException) { Wallpaper.CreateTestBackgroundImage(); } }
/// <summary> /// Display the current images on the background /// </summary> public void Refresh() { try { Screen[] screens = Screen.AllScreens; Dictionary <string, DesktopImage> images = new Dictionary <string, DesktopImage>(screens.Length); for (int i = 0; i < screens.Length; i++) { Screen screen = screens[i]; images[screen.DeviceName] = new DesktopImage(ImageList.Current(screen.DeviceName)); } Wallpaper.CreateBackgroundImage(images, _controlerForms); } catch (MissingImagesException) { Wallpaper.CreateTestBackgroundImage(); } }