/// <summary> /// Release the power lock /// </summary> /// <param name="state">The power state</param> public static void Release(PowerLockState state) { Power.ReleaseLock((PowerLock)state); }
/// <summary> /// Release the power lock /// </summary> /// <param name="state">The power state</param> public static void Release(PowerLockState state) { _ = NativeMethods.DevicePowerReleaseLock((int)state); }
/// <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); }
/// <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); }