private void checkWallpaperTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (!WallpaperChecker.Instance().IsChecking) { checkWallpaper(); } }
private void checkWallpaper() { System.Threading.Thread checkWallpaperThread = new System.Threading.Thread(new System.Threading.ThreadStart( delegate { WallpaperChecker.Instance().BeginCheckWallpaper(); } )); checkWallpaperThread.Start(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.Hide(); MotivateDesktopNotifyIcon.Instance(); WallpaperChecker.Instance().GotWallpaperPreview += new WallpaperChecker.GotWallpaperPreviewEventHandler(GotWallpaperPreview); WallpaperChecker.Instance().FailedGettingWallpaperPreview += new WallpaperChecker.FailedGettingWallpaperPreviewEventHandler(FailedGettingWallpaperPreview); checkWallpaper(); System.Timers.Timer checkWallpaperTimer = new System.Timers.Timer(15 * 60 * 1000); checkWallpaperTimer.Elapsed += new System.Timers.ElapsedEventHandler(checkWallpaperTimer_Elapsed); checkWallpaperTimer.Start(); setAutoexitTimerEnabled(MotivateDesktop.Properties.Settings.Default.AutoExit); }
void latestWallpaperMenuItem_Click(object sender, EventArgs e) { BackgroundWindow.ShouldForceShowWallpaperPreviewWindow = true; ShowBalloonTip("正在检测壁纸", "稍后会有提示..."); if (!WallpaperChecker.Instance().IsChecking) { System.Threading.Thread checkWallpaperThread = new System.Threading.Thread(new System.Threading.ThreadStart( delegate { WallpaperChecker.Instance().BeginCheckWallpaper(); } )); checkWallpaperThread.Start(); } }
private void setWallpaper_MouseDown(object sender, MouseEventArgs e) { WallpaperDownloader wallpaperDownloader = WallpaperDownloader.Instance(); if (wallpaperDownloader.IsDownloading) { MotivateDesktopNotifyIcon.Instance().ShowBalloonTip("正在下载", "有一张壁纸正在下载,请等待下载完成..."); } else { System.Threading.Thread wallpaperDownloadThread = new System.Threading.Thread(new System.Threading.ThreadStart( delegate { wallpaperDownloader.DownloadAndApplyWallpaper(WallpaperChecker.Instance().WallpaperDate, WallpaperChecker.Instance().WallpaperFormat); } )); wallpaperDownloadThread.Start(); } AnimatedCloseMainWrapper(); }