Beispiel #1
0
        private void batteryManagement()
        {
            // Charge Level
            float turner    = Screen.PrimaryScreen.WorkingArea.Height * SystemInformation.PowerStatus.BatteryLifePercent;
            int   turnerInt = (int)Math.Ceiling(turner);

            if (SystemInformation.PowerStatus.BatteryChargeStatus != BatteryChargeStatus.Charging && SystemInformation.PowerStatus.BatteryLifePercent > 0.08 && SystemInformation.PowerStatus.BatteryLifePercent <= 0.12 && !l1)
            {
                l1 = true;
                BattLow nbl = new BattLow();
                nbl.Show();
                nbl.BringToFront();
            }
            else if (SystemInformation.PowerStatus.BatteryChargeStatus != BatteryChargeStatus.Charging && SystemInformation.PowerStatus.BatteryLifePercent <= 0.08 && !l2)
            {
                l2 = true;
                BattCritical bcr = new BattCritical();
                bcr.Show();
                bcr.BringToFront();
            }
            else if (SystemInformation.PowerStatus.BatteryLifePercent > 0.12 || SystemInformation.PowerStatus.BatteryChargeStatus == BatteryChargeStatus.Charging)
            {
                l1 = l2 = false;
            }
        }
Beispiel #2
0
        private void battLowToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BattLow battLowA = new BattLow();

            battLowA.Show();
            battLowA.BringToFront();
        }
Beispiel #3
0
 private void battLowToolStripMenuItem_Click(object sender, EventArgs e)
 {
     BattLow battLowA = new BattLow();
     battLowA.Show();
     battLowA.BringToFront();
 }
        private void batteryManagement()
        {
            // Charge Level
            float turner = Screen.PrimaryScreen.WorkingArea.Height * SystemInformation.PowerStatus.BatteryLifePercent;
            int turnerInt = (int)Math.Ceiling(turner);

            if (SystemInformation.PowerStatus.BatteryChargeStatus != BatteryChargeStatus.Charging && SystemInformation.PowerStatus.BatteryLifePercent > 0.08 && SystemInformation.PowerStatus.BatteryLifePercent <= 0.12 && !l1)
            {
                l1 = true;
                BattLow nbl = new BattLow();
                nbl.Show();
                nbl.BringToFront();
            }
            else if (SystemInformation.PowerStatus.BatteryChargeStatus != BatteryChargeStatus.Charging && SystemInformation.PowerStatus.BatteryLifePercent <= 0.08 && !l2)
            {
                l2 = true;
                BattCritical bcr = new BattCritical();
                bcr.Show();
                bcr.BringToFront();
            }
            else if (SystemInformation.PowerStatus.BatteryLifePercent > 0.12 || SystemInformation.PowerStatus.BatteryChargeStatus == BatteryChargeStatus.Charging)
            {
                l1 = l2 = false;
            }
        }