internal WeekApplicationContext() { try { Log.LogCaller(); //MonitorProcess.Run(); // Removed because of false positive virus varning _updateHandler = UpdateHandler.Instance; Settings.StartWithWindows = Settings.SettingIsValue(Resources.StartWithWindows, true.ToString()); Application.ApplicationExit += OnApplicationExit; SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; _currentWeek = Week.Current(); _lastIconRes = WeekIcon.GetIconResolution(); Gui = new TaskbarGui(_currentWeek, _lastIconRes); Gui.UpdateRequest += GuiUpdateRequestHandler; _timer = GetTimer; AutoUpdateCheck(); } catch (Exception ex) { _timer?.Stop(); Log.LogCaller(); Message.Show(Resources.UnhandledException, ex); Application.Exit(); } }
private void OnUserPreferenceChanged(object sender, EventArgs e) { Log.LogCaller(); AutoUpdateCheck(); int iconRes = WeekIcon.GetIconResolution(true); if (iconRes != _lastIconRes) { UpdateIcon(true, true); _lastIconRes = iconRes; } }