C# Class Dbot.Service.PrimaryService

Inheritance: System.ServiceProcess.ServiceBase
Mostrar archivo Open project: destinygg/bot

Public Methods

Method Description
PrimaryService ( ) : System

Public Constructor for WindowsService. - Put all of your Initialization code here.

WriteExceptionDetails ( Exception exception, StringBuilder builderToFill, int level ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose of objects that need it here.

OnContinue ( ) : void

OnContinue(): Put your continue code here - Un-pause working threads, etc.

OnCustomCommand ( int command ) : void

OnCustomCommand(): If you need to send a command to your service without the need for Remoting or Sockets, use this method to do custom methods.

OnPause ( ) : void

OnPause: Put your pause code here - Pause working threads, etc.

OnPowerEvent ( PowerBroadcastStatus powerStatus ) : bool

OnPowerEvent(): Useful for detecting power status changes, such as going into Suspend mode or Low Battery for laptops.

OnSessionChange ( System.ServiceProcess.SessionChangeDescription changeDescription ) : void

OnSessionChange(): To handle a change event from a Terminal Server session. Useful if you need to determine when a user logs in remotely or logs off, or when someone logs into the console.

OnShutdown ( ) : void

OnShutdown(): Called when the System is shutting down - Put code here when you need special handling of code that deals with a system shutdown, such as saving special data before shutdown.

OnStart ( string args ) : void

OnStart(): Put startup code here - Start threads, get inital data, etc.

OnStop ( ) : void

OnStop(): Put your stop code here - Stop threads, set final data, etc.

Method Details

Dispose() protected method

Dispose of objects that need it here.
protected Dispose ( bool disposing ) : void
disposing bool Whether /// or not disposing is going on.
return void

OnContinue() protected method

OnContinue(): Put your continue code here - Un-pause working threads, etc.
protected OnContinue ( ) : void
return void

OnCustomCommand() protected method

OnCustomCommand(): If you need to send a command to your service without the need for Remoting or Sockets, use this method to do custom methods.
protected OnCustomCommand ( int command ) : void
command int Arbitrary Integer between 128 & 256
return void

OnPause() protected method

OnPause: Put your pause code here - Pause working threads, etc.
protected OnPause ( ) : void
return void

OnPowerEvent() protected method

OnPowerEvent(): Useful for detecting power status changes, such as going into Suspend mode or Low Battery for laptops.
protected OnPowerEvent ( PowerBroadcastStatus powerStatus ) : bool
powerStatus PowerBroadcastStatus The Power Broadcast Status /// (BatteryLow, Suspend, etc.)
return bool

OnSessionChange() protected method

OnSessionChange(): To handle a change event from a Terminal Server session. Useful if you need to determine when a user logs in remotely or logs off, or when someone logs into the console.
protected OnSessionChange ( System.ServiceProcess.SessionChangeDescription changeDescription ) : void
changeDescription System.ServiceProcess.SessionChangeDescription The Session Change /// Event that occured.
return void

OnShutdown() protected method

OnShutdown(): Called when the System is shutting down - Put code here when you need special handling of code that deals with a system shutdown, such as saving special data before shutdown.
protected OnShutdown ( ) : void
return void

OnStart() protected method

OnStart(): Put startup code here - Start threads, get inital data, etc.
protected OnStart ( string args ) : void
args string
return void

OnStop() protected method

OnStop(): Put your stop code here - Stop threads, set final data, etc.
protected OnStop ( ) : void
return void

PrimaryService() public method

Public Constructor for WindowsService. - Put all of your Initialization code here.
public PrimaryService ( ) : System
return System

WriteExceptionDetails() public static method

public static WriteExceptionDetails ( Exception exception, StringBuilder builderToFill, int level ) : void
exception System.Exception
builderToFill StringBuilder
level int
return void