Exemplo n.º 1
0
        private void TmCheckPower_Tick(object sender, EventArgs e)
        {
            var idleTimeMin = PcIdle.GetIdleTimeMin();

            // Refresh Form data.
            ShowPowerStatus();
            TbIdleTime.Text = idleTimeMin.ToString("D");

            if (NotifyVoice && NotifyWind)
            {
                // Check if activate Voice notification for idle time.
                IdleVoiceNotify = !NotifyWind || idleTimeMin >= PcIdle.MaxIdleTime;
            }

            if (!Battery.CheckPowerLevel())
            {
                Battery.AuxAlert = false;
                return;
            }
            BtnSpeak.Enabled = false;
            if (Battery.AuxAlert && (Voice.AuxNotVolume += 10) > 100)
            {
                Voice.AuxNotVolume = 100;
            }
            NewNotification($"{Settings.Default.PcName}. {Battery.Msg}");
            TmCheckPower.Stop();
            TmWaitForResp.Start();
            GbNextNot.Enabled = true;
            Application.DoEvents();
        }
Exemplo n.º 2
0
        private void TmCheckPower_Tick(object sender, EventArgs e)
        {
            ShowPowerStatus();
            var idleTimeMin = PcInnactivity.GetIdleTimeMin();

            _voiceNotify    = idleTimeMin >= PcInnactivity.MaxIdleTime;
            TbIdleTime.Text = idleTimeMin.ToString("D");
            if (!Battery.CheckPowerLevel())
            {
                return;
            }
            NewNotification(Battery.Msg);
            if (Battery.Alert == Battery.Alerts.LowBattery)
            {
                SpeakLifeRemaining(@"Tiempo de batería restante:");
            }
            TmWaitForResp.Enabled = true;
        }