コード例 #1
0
        private void pb_DisplayStateChanged(object sender, DisplayStateEventArgs e)
        {
            int    id  = DisplayStateChangedEventId + (int)e.DisplayState;
            string msg = "The current monitor's display state has changed: "
                         + e.DisplayState.ToString();

            WriteLogEntry(msg, id);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: apsun/PowerPlanChanger
 private void _powerNotification_DisplayStateChanged(object sender, DisplayStateEventArgs e)
 {
     switch (e.DisplayState)
     {
         case DisplayStateEventArgs.DisplayStateType.Dimmed:
             TimeLog("Screen dimming");
             break;
         case DisplayStateEventArgs.DisplayStateType.Off:
             TimeLog("Screen turned off");
             break;
         case DisplayStateEventArgs.DisplayStateType.On:
             TimeLog("Screen turned on");
             break;
     }
 }