Ejemplo n.º 1
0
 /// <summary>
 /// Release the power lock
 /// </summary>
 /// <param name="state">The power state</param>
 public static void Release(PowerLockState state)
 {
     Power.ReleaseLock((PowerLock)state);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Release the power lock
 /// </summary>
 /// <param name="state">The power state</param>
 public static void Release(PowerLockState state)
 {
     _ = NativeMethods.DevicePowerReleaseLock((int)state);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Acquire the power lock and let the device stay on at the state requested
 /// </summary>
 /// <remarks>
 /// A value of 0 permanently holds the power lock
 /// </remarks>
 /// <param name="state">The power state</param>
 /// <param name="timeout">The time until the request times out, in milliseconds</param>
 public static void Request(PowerLockState state, int timeout = 0)
 {
     Power.RequestLock((PowerLock)state, timeout);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Acquire the power lock and let the device stay on at the state requested
 /// </summary>
 /// <remarks>
 /// A value of 0 permanently holds the power lock
 /// </remarks>
 /// <param name="state">The power state</param>
 /// <param name="timeout">The time until the request times out, in milliseconds</param>
 public static void Request(PowerLockState state, int timeout = 0)
 {
     _ = NativeMethods.DevicePowerRequestLock((int)state, timeout);
 }