protected override void OnExit(ExitEventArgs e) { WallpaperManager.Dispose(); NLog.LogManager.Shutdown(); notifyIcon.Dispose(); base.OnExit(e); }
public WallpaperClockEngine(Context wall) : base(wall as WallpaperClockService) { mContext = wall; start_time = SystemClock.ElapsedRealtime(); try { WallpaperManager wpMgr = WallpaperManager.GetInstance(wall); wallpaperDrawable = wpMgr.Drawable; wpMgr.Dispose(); } catch (System.Exception ex) { try { WallpaperManager wpMgr = WallpaperManager.GetInstance(wall); wallpaperDrawable = wpMgr.BuiltInDrawable; wpMgr.Dispose(); } catch (System.Exception ex2) { ex2.ToString(); } ex.ToString(); } if (wallpaperDrawable == null) { wallpaperDrawable = wall.Resources.GetDrawable(Resource.Drawable.dummy_wallpaper, null); } clockView.FlowMinuteHand = true; clockView.FlowSecondHand = false; clockView.ColorTickMarks = clockView.ColorHourHandStroke = clockView.ColorMinuteHandStroke = clockView.ColorSecondHandStroke = xColor.WhiteSmoke; clockView.ColorHourHandFill = clockView.ColorMinuteHandFill = xColor.Transparent; // Set up the paint to draw the lines for our cube paint.Color = Color.White; paint.AntiAlias = true; paint.StrokeWidth = 2; paint.StrokeCap = Paint.Cap.Round; paint.SetStyle(Paint.Style.Stroke); mDrawCube = delegate { DrawFrame(); }; }
private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e) { //关机时恢复系统壁纸,防止开机黑屏 //HandlerWallpaper.DesktopWallpaperAPI.Enable(true); WallpaperManager.Dispose(); }
public void Dispose() { WallpaperManager.Dispose(); }