예제 #1
0
        private void UpdateLabel2()
        {
            if (FormWindowState.Minimized == this.WindowState)
            {
                this.SetLabel2("Minimized");
                return;
            }

            //this.SetLabel2($"{DateTime.Now.ToString("hh:mm:ss")} Ïdle seconds:{idletimer.idletimeinsecs} MonitorOff:{MonitorOff}");
            var status = $"{DateTime.Now.ToString("hh:mm:ss")} Ïdle seconds:{idletimer.idletimeinsecs}";

            if (MediaWatcher.IsWindowsPlayingSound())
            {
#if DEBUG
                status += $" {status} Playing {MediaWatcher.getPeakValue()}";
#else
                status += $" {status} AudioPlaying";
#endif
            }
            else
            {
                status += $" {status} AudioNotPlaying";
            }

            this.SetLabel2(status);
        }
예제 #2
0
 private void Idletimer_BeforeIdleTimeReached(object sender, EventArgs e)
 {
     if (MediaWatcher.IsWindowsPlayingSound())
     {
         return;
     }
     notifyIcon1.BalloonTipText = "SystemSleep will put your system to sleep now";
     notifyIcon1.ShowBalloonTip(500);
     ScreenHelper.TurnOffScreen(this.Handle);
 }