コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }