C# Класс WebApplications.Utilities.Service.BaseService

Наследование: System.ServiceProcess.ServiceBase
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
IsService bool

Открытые методы

Метод Описание
Connect ( [ connection ) : System.Guid

Connects the specified connection.

Disconnect ( System.Guid id ) : bool

Disconnects the specified user interface.

Run ( RunMode runMode = RunMode.Default ) : void

Runs the service, either as a service or as a console application.

Защищенные методы

Метод Описание
BaseService ( [ name, [ displayName, [ description, [ serverConfiguration = null ) : System

Initializes a new instance of the BaseService class.

DoContinue ( ) : void

When implemented in a derived class, M:System.ServiceProcess.ServiceBase.OnContinue runs when a Continue command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service resumes normal functioning after being paused.

DoCustomCommand ( int command ) : void

When implemented in a derived class, M:System.ServiceProcess.ServiceBase.OnCustomCommand(System.Int32) executes when the Service Control Manager (SCM) passes a custom command to the service. Specifies actions to take when a command with the specified parameter value occurs.

DoPause ( ) : void

When implemented in a derived class, executes when a Pause command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service pauses.

DoPowerEvent ( PowerBroadcastStatus powerStatus ) : bool

When implemented in a derived class, executes when the computer's power status has changed. This applies to laptop computers when they go into suspended mode, which is not the same as a system shutdown.

DoSessionChange ( System.ServiceProcess.SessionChangeDescription changeDescription ) : void

Executes when a change event is received from a Terminal Server session.

DoShutdown ( ) : void

When implemented in a derived class, executes when the system is shutting down. Specifies what should occur immediately prior to the system shutting down.

DoStart ( [ args ) : void
DoStop ( ) : void

When implemented in a derived class, executes when a Stop command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service stops running.

Приватные методы

Метод Описание
BaseService ( ) : System

Initializes static members of the BaseService class.

Continue ( [ writer, CancellationToken token = default(CancellationToken) ) : Task
CustomCommand ( [ writer, [ command, CancellationToken token = default(CancellationToken) ) : Task
ExecuteAsync ( System.Guid id, [ commandLine, [ writer, CancellationToken token = default(CancellationToken) ) : Task
Help ( [ writer, [ command = null, [ parameter = null ) : void
Install ( [ writer, [ userName = null, [ password = null ) : void
Pause ( [ writer, CancellationToken token = default(CancellationToken) ) : Task
Performance ( [ writer, [ category = null ) : void
PowerEvent ( [ writer, [ powerStatus ) : bool
RunAsync ( RunMode runMode = RunMode.Default, CancellationToken token = default(CancellationToken) ) : Task
SessionChange ( [ writer, [ changeReason, [ sessionId ) : void
Shutdown ( [ writer ) : bool
StartService ( [ writer, [ args, CancellationToken token = default(CancellationToken) ) : Task
StopService ( [ writer, CancellationToken token = default(CancellationToken) ) : Task
Uninstall ( [ writer, CancellationToken token = default(CancellationToken) ) : Task

Описание методов

BaseService() защищенный Метод

Initializes a new instance of the BaseService class.
protected BaseService ( [ name, [ displayName, [ description, [ serverConfiguration = null ) : System
name [ The name.
displayName [ The display name.
description [ The description.
serverConfiguration [ The server configuration.
Результат System

Connect() публичный абстрактный Метод

Connects the specified connection.
public abstract Connect ( [ connection ) : System.Guid
connection [ The connection.
Результат System.Guid

Disconnect() публичный абстрактный Метод

Disconnects the specified user interface.
public abstract Disconnect ( System.Guid id ) : bool
id System.Guid The connection.
Результат bool

DoContinue() защищенный Метод

When implemented in a derived class, M:System.ServiceProcess.ServiceBase.OnContinue runs when a Continue command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service resumes normal functioning after being paused.
protected DoContinue ( ) : void
Результат void

DoCustomCommand() защищенный Метод

When implemented in a derived class, M:System.ServiceProcess.ServiceBase.OnCustomCommand(System.Int32) executes when the Service Control Manager (SCM) passes a custom command to the service. Specifies actions to take when a command with the specified parameter value occurs.
protected DoCustomCommand ( int command ) : void
command int The command message sent to the service.
Результат void

DoPause() защищенный Метод

When implemented in a derived class, executes when a Pause command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service pauses.
protected DoPause ( ) : void
Результат void

DoPowerEvent() защищенный Метод

When implemented in a derived class, executes when the computer's power status has changed. This applies to laptop computers when they go into suspended mode, which is not the same as a system shutdown.
protected DoPowerEvent ( PowerBroadcastStatus powerStatus ) : bool
powerStatus PowerBroadcastStatus A that indicates a notification from the system about its power status.
Результат bool

DoSessionChange() защищенный Метод

Executes when a change event is received from a Terminal Server session.
protected DoSessionChange ( System.ServiceProcess.SessionChangeDescription changeDescription ) : void
changeDescription System.ServiceProcess.SessionChangeDescription A structure that identifies the change type.
Результат void

DoShutdown() защищенный Метод

When implemented in a derived class, executes when the system is shutting down. Specifies what should occur immediately prior to the system shutting down.
protected DoShutdown ( ) : void
Результат void

DoStart() защищенный Метод

protected DoStart ( [ args ) : void
args [
Результат void

DoStop() защищенный Метод

When implemented in a derived class, executes when a Stop command is sent to the service by the Service Control Manager (SCM). Specifies actions to take when a service stops running.
protected DoStop ( ) : void
Результат void

Run() публичный Метод

Runs the service, either as a service or as a console application.
public Run ( RunMode runMode = RunMode.Default ) : void
runMode RunMode The run mode.
Результат void

Описание свойств

IsService публичное свойство

Whether the service is running as a service.
public bool IsService
Результат bool