C# Class Zazzles.Power

Handle all shutdown requests The windows shutdown command is used instead of the win32 api because it notifies the user prior
Mostrar archivo Open project: FOGProject/zazzles

Public Methods

Method Description
AbortShutdown ( ) : void

Abort a shutdown if it is not to late

CreateTask ( string parameters ) : void

Create a shutdown command

Hibernate ( ) : void

Hibernate the computer

IsActionPending ( ) : bool
LockWorkStation ( ) : void

Lock the workstation

LogOffUser ( ) : void

Entry off the current user

QueueShutdown ( string parameters, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int gracePeriod = -1 ) : void
Restart ( string comment, Func abortCheckFunc, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
Restart ( string comment, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
Shutdown ( string comment, Func abortCheckFunc, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
Shutdown ( string comment, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void

Private Methods

Method Description
DelayShutdown ( dynamic data ) : void
ExecutePendingShutdown ( ) : void
HelpShutdown ( dynamic data ) : void

Called when a shutdown is requested via the Bus

ParseBus ( dynamic data ) : void
Power ( ) : System
ShouldAbort ( ) : bool
TimerElapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Method Details

AbortShutdown() public static method

Abort a shutdown if it is not to late
public static AbortShutdown ( ) : void
return void

CreateTask() public static method

Create a shutdown command
public static CreateTask ( string parameters ) : void
parameters string The parameters to use
return void

Hibernate() public static method

Hibernate the computer
public static Hibernate ( ) : void
return void

IsActionPending() public static method

public static IsActionPending ( ) : bool
return bool

LockWorkStation() public static method

Lock the workstation
public static LockWorkStation ( ) : void
return void

LogOffUser() public static method

Entry off the current user
public static LogOffUser ( ) : void
return void

QueueShutdown() public static method

public static QueueShutdown ( string parameters, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int gracePeriod = -1 ) : void
parameters string
options ShutdownOptions
message string
gracePeriod int
return void

Restart() public static method

public static Restart ( string comment, Func abortCheckFunc, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
comment string
abortCheckFunc Func
options ShutdownOptions
message string
seconds int
return void

Restart() public static method

public static Restart ( string comment, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
comment string
options ShutdownOptions
message string
seconds int
return void

Shutdown() public static method

public static Shutdown ( string comment, Func abortCheckFunc, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
comment string
abortCheckFunc Func
options ShutdownOptions
message string
seconds int
return void

Shutdown() public static method

public static Shutdown ( string comment, ShutdownOptions options = ShutdownOptions.Abort, string message = null, int seconds ) : void
comment string
options ShutdownOptions
message string
seconds int
return void