コード例 #1
0
        private void RaiseWallpaperSelectedEvent(string filename)
        {
            if (WallpaperSelectedEvent != null)
            {
                WallpaperSelectedEventArgs e = new WallpaperSelectedEventArgs();
                e.SelectedScreen    = _myScreen;
                e.WallpaperFilename = filename;
                e.ScreenIndex       = _screenIndex;

                WallpaperSelectedEvent(this, e);
            }
        }
コード例 #2
0
        /// <summary>
        /// Fires when one of the drop regions receives a file drop
        /// </summary>
        void MonitorSelectForm_WallpaperSelectedEvent(object sender, WallpaperSelectedEventArgs e)
        {
            // Update the corresponding wallpaper filename
            wallpaperFilenames[e.ScreenIndex] = e.WallpaperFilename;

            // Copy the array of filenames back to settings to save
            Properties.Settings.Default.SelectedImages.Clear();
            Properties.Settings.Default.SelectedImages.AddRange(wallpaperFilenames);
            Properties.Settings.Default.Save();

            UpdatePreviewImage();
            UpdateDesktopImage();
        }