Example #1
0
 protected override bool OnPowerEvent(System.ServiceProcess.PowerBroadcastStatus powerStatus)
 {
     if (powerStatus == System.ServiceProcess.PowerBroadcastStatus.Suspend)
     {
         AudioMeterEvent.Stop();
     }
     if (powerStatus == System.ServiceProcess.PowerBroadcastStatus.ResumeSuspend)
     {
         AudioMeterEvent.Start();
     }
     return(base.OnPowerEvent(powerStatus));
 }
        protected override bool OnPowerEvent(System.ServiceProcess.PowerBroadcastStatus powerStatus)
        {
            switch (powerStatus)
            {
            case System.ServiceProcess.PowerBroadcastStatus.ResumeAutomatic:
                OnNeedsReset();
                break;

            case System.ServiceProcess.PowerBroadcastStatus.ResumeCritical:
                OnNeedsReset();
                break;

            case System.ServiceProcess.PowerBroadcastStatus.ResumeSuspend:
                OnNeedsReset();
                break;

            default:
                break;
            }
            return(true);
        }
Example #3
0
 protected virtual bool OnPowerEvent(System.ServiceProcess.PowerBroadcastStatus powerStatus)
 {
     throw null;
 }
Example #4
0
 public void ServicePowerEvent(System.ServiceProcess.PowerBroadcastStatus status)
 {
     base.Channel.ServicePowerEvent(status);
 }
Example #5
0
 /// <summary>
 /// When implemented in a derived class, executes when the computer's power status has changed. This applies to laptop computers when they go into suspended mode, which is not the same as a system shutdown.
 /// </summary>
 /// <param name="powerStatus">A <see cref="T:System.ServiceProcess.PowerBroadcastStatus"/> that indicates a notification from the system about its power status.</param>
 /// <returns>
 /// When implemented in a derived class, the needs of your application determine what value to return. For example, if a QuerySuspend broadcast status is passed, you could cause your application to reject the query by returning false.
 /// </returns>
 protected override bool OnPowerEvent(System.ServiceProcess.PowerBroadcastStatus powerStatus)
 {
     return(base.OnPowerEvent(powerStatus));
 }
Example #6
0
 public bool OnPowerEvent(System.ServiceProcess.PowerBroadcastStatus powerStatus)
 {
     throw new NotImplementedException();
 }