示例#1
0
 private void _HideBalloon()
 {
     Taskbar.Show();
     _allowExit             = true;
     notifyIconMain.Visible = false;
     Hide();
 }
示例#2
0
 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();
     }
 }
示例#3
0
 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();
 }
示例#4
0
 private static void OnProcessExit(object sender, EventArgs e)
 {
     Taskbar.Show();
 }