Beispiel #1
0
 /// <summary>
 /// Invoked to reset the state machine.
 /// </summary>
 public void Reset()
 {
     CurrentState   = StartState;
     ExecutionState = ExecutionStates.Idle;
     NormalPriorityEventQueue.Clear();
     HighPriorityEventQueue.Clear();
     EventTrace.Reset();
 }
Beispiel #2
0
        /// <summary>
        /// Allows an application to inform the system that it
        /// is in use, thereby preventing the system from entering
        /// the sleeping power state or turning off the display
        /// while the application is running.
        /// </summary>
        /// <param name="executionStateOptions">The thread's execution requirements.</param>
        /// <exception cref="Win32Exception">Thrown if the SetThreadExecutionState call fails.</exception>
        public static void SetThreadExecutionState(ExecutionStates executionStateOptions)
        {
            ExecutionStates ret = PowerManagementNativeMethods.SetThreadExecutionState(executionStateOptions);

            if (ret == ExecutionStates.None)
            {
                throw new Win32Exception(LocalizedMessages.PowerExecutionStateFailed);
            }
        }
Beispiel #3
0
 static extern ExecutionStates SetThreadExecutionState(ExecutionStates executionStateFlag);
Beispiel #4
0
		/// <summary>
		/// Allows an application to inform the system that it 
		/// is in use, thereby preventing the system from entering 
		/// the sleeping power state or turning off the display 
		/// while the application is running.
		/// </summary>
		/// <param name="executionStateOptions">The thread's execution requirements.</param>
		/// <exception cref="Win32Exception">Thrown if the SetThreadExecutionState call fails.</exception>
		public static void SetThreadExecutionState(ExecutionStates executionStateOptions) {
			ExecutionStates ret = PowerManagementNativeMethods.SetThreadExecutionState(executionStateOptions);
			if (ret == ExecutionStates.None) {
				throw new Win32Exception(LocalizedMessages.PowerExecutionStateFailed);
			}
		}
Beispiel #5
0
 internal static extern ExecutionStates SetThreadExecutionState(ExecutionStates esFlags);
Beispiel #6
0
 public static extern ExecutionStates SetThreadExecutionState(ExecutionStates esFlags);
 internal static extern ExecutionStates SetThreadExecutionState(ExecutionStates esFlags);
 public static extern ExecutionStates SetThreadExecutionState(ExecutionStates flags);
 public static bool Is(this ExecutionStates self, ExecutionStates target) {
     return ((int)self & (int)target) != 0 || self == target ;
 }