private void _HideBalloon() { Taskbar.Show(); _allowExit = true; notifyIconMain.Visible = false; Hide(); }
private static void Run() { AppDomain.CurrentDomain.ProcessExit += OnProcessExit; Taskbar.Show(); Debug.WriteLine(Setting.Instance); SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CheckBattery(); GlobalConfiguration.Configuration.UseMemoryStorage(); //FormMain.Instance.ShowBalloon(Setting.Instance.MinBatteryAlertTitle, Setting.Instance.MinBatteryAlertMessage,false); using (new BackgroundJobServer()) { RecurringJob.AddOrUpdate("Main", () => CheckBattery(), Cron.Minutely); Application.Run(); } }
private void _ShowBalloon(string description, bool highBattery) { _allowExit = false; notifyIconMain.Visible = true; notifyIconMain.Icon = Icon; notifyIconMain.Icon = highBattery ? Resources.battery_full_icon : Resources.battery_empty_icon;; notifyIconMain.BalloonTipIcon = ToolTipIcon.Warning; notifyIconMain.BalloonTipTitle = description; notifyIconMain.BalloonTipText = description; notifyIconMain.ShowBalloonTip(3000); WindowState = FormWindowState.Maximized; Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); warningControlMain.Title = description; warningControlMain.LocateOnCenterOf(this); warningControlMain.HighBattery = highBattery; Show(); Taskbar.Hide(); }
private static void OnProcessExit(object sender, EventArgs e) { Taskbar.Show(); }