Example #1
0
        public TestingViewModel()
        {
            SwitchUserCommand = new ReactiveCommand(Observable.Return(false));
            LockCommand       = new ReactiveCommand();
            SleepCommand      = new ReactiveCommand();
            HibernateCommand  = new ReactiveCommand();

            SleepCommand.Do(_ => { Powrprof.SwitchToStandby(); }).Subscribe().AddTo(_subscriptions);
            HibernateCommand.Do(_ => { Powrprof.SwitchToHibernate(); }).Subscribe().AddTo(_subscriptions);
            LockCommand.Do(_ => { User32.LockWorkStation(); }).Subscribe().AddTo(_subscriptions);
        }
Example #2
0
 public static void Hibernate()
 {
     Powrprof.SetSuspendState(true, false, false);
 }
Example #3
0
 public static void Suspend()
 {
     Powrprof.SetSuspendState(false, false, false);
 }
Example #4
0
 private void buttonSuspend_Click(object sender, RoutedEventArgs e)
 {
     OrderEntryCommands.ExecuteLogoutCommand();
     Powrprof.SetSuspendState(false, true, false);
 }
Example #5
0
 public static bool Hibernate()
 {
     return(Powrprof.SetSuspendState(true, true, false));
 }
Example #6
0
 public static bool Sleep()
 {
     return(Powrprof.SetSuspendState(false, true, false));
 }