private void button_start_Click(object sender, EventArgs e) { WallPaperConfigurationValues config = new WallPaperConfigurationValues(); config.intervall_in_seconds = this.ChangeIntervallinSeconds; if (leftScreen_static == false) { config.leftScreenStatic = false; config.leftScreenImageSource = this.lefttScreen_FolderPath; } else { config.leftScreenStatic = true; config.leftScreenImageSource = this.lefttScreen_staticPath; } if (rightScreen_static == false) { config.rightScreenStatic = false; config.rightScreenImageSource = this.rightScreen_FolderPath; } else { config.rightScreenStatic = true; config.rightScreenImageSource = this.rightScreen_staticPath; } config.x_resolution_left_screen = this.leftScreen_XRes; config.x_resolution_right_screen = this.rightScreen_XRes; config.y_resolution_left_screen = this.leftScreen_YRes; config.y_resolution_right_screen = this.rightScreen_YRes; this.wallpapermanager = new WallPaperManager(config); this.wallpapermanager.startTimer(); }
public WallPaperManager() { timer.AutoReset = true; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); config = WallpaperConfiguration.getWallpaperConfigurationValues(); timer.Interval = config.intervall_in_seconds * 1000; updateWallpaper(); }
public WallPaperManager(WallPaperConfigurationValues _config) { timer.AutoReset = true; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); config = _config; WallpaperConfiguration.saveNewConfig(config); timer.Interval = config.intervall_in_seconds * 1000; timer.Start(); updateWallpaper(); }
/// <summary> /// Loads a configuration from XML file /// </summary> /// <returns>object of WallPaperConfigurationValues</returns> private static void loadConfig() { bool config_exists = checkIfConfigExists(); if (config_exists) { config_values = Serialization.ReadFromXmlFile <WallPaperConfigurationValues>(config_file_path); WallPaperConfigurationValues new_config = new WallPaperConfigurationValues(); } else { createConfig(); } }
public static void saveNewConfig(WallPaperConfigurationValues config) { config_values = config; createConfig(); }