Beispiel #1
0
        /// <summary>
        /// The Sleep method puts the device into a sleeps state that is only woken by the events described in the paramter wakeUpEvents.
        /// Please note that if the event SystemTimer is not used, the system will not be woken up by any managed timers.  In addition,
        /// other threads will not be executed until this sleep call exits.  This method raises the OnSleepChange event.
        ///
        /// The MaximumTimeToActive property contains the timeout value for this call.
        /// </summary>
        /// <param name="level">Determines what level of sleep the system should enter.  The behavior of the level is determined
        /// by the hardware vendor.</param>
        /// <param name="wakeUpEvents">Determines the events that will cause the system to exit the given sleep level</param>
        public static void Sleep(SleepLevel level, HardwareEvent wakeUpEvents)
        {
            SleepChangeEventHandler h = OnSleepChange;

            if (h != null)
            {
                SleepEvent e = new SleepEvent();

                e.EventType    = SleepEventType.ChangeRequested;
                e.Level        = level;
                e.WakeUpEvents = wakeUpEvents;
                e.Time         = DateTime.UtcNow;

                h(e);
            }

            InternalSleep(level, wakeUpEvents);
        }
Beispiel #2
0
 extern private static void InternalSleep(SleepLevel level, HardwareEvent wakeUpEvents);
Beispiel #3
0
        /// <summary>
        /// The Sleep method puts the device into a sleeps state that is only woken by the events described in the paramter wakeUpEvents.
        /// Please note that if the event SystemTimer is not used, the system will not be woken up by any managed timers.  In addition,
        /// other threads will not be executed until this sleep call exits.  This method raises the OnSleepChange event.
        ///
        /// The MaximumTimeToActive property contains the timeout value for this call.
        /// </summary>
        /// <param name="level">Determines what level of sleep the system should enter.  The behavior of the level is determined
        /// by the hardware vendor.</param>
        /// <param name="wakeUpEvents">Determines the events that will cause the system to exit the given sleep level</param>
        public static void Sleep(SleepLevel level, HardwareEvent wakeUpEvents)
        {
            SleepChangeEventHandler h = OnSleepChange;

            if (h != null)
            {
                SleepEvent e = new SleepEvent();

                e.EventType = SleepEventType.ChangeRequested;
                e.Level = level;
                e.WakeUpEvents = wakeUpEvents;
                e.Time = DateTime.UtcNow;

                h(e);
            }

            InternalSleep(level, wakeUpEvents);
        }
Beispiel #4
0
 extern private static void InternalSleep(SleepLevel level, HardwareEvent wakeUpEvents);