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); }
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; } }