C# Класс winsw.WrapperService

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

Private Properties

Свойство Тип Описание
CopyFile void
HandleFileCopies void
HandleLogfiles void
InitLoggers void
ReadPassword string
SignalShutdownComplete void
SignalShutdownPending void
StartProcess void
StartThread void
StopIt void
ThrowNoSuchService void
WaitForProcessToExit void
printAvailableCommandsInfo void
printHelp void
printVersion void

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

Метод Описание
LogEvent ( String message ) : void
LogEvent ( String message, EventLogEntryType type ) : void
Main ( string args ) : int
Run ( string _args, winsw.ServiceDescriptor descriptor = null ) : void

Runs the wrapper.

WrapperService ( ) : System
WrapperService ( winsw.ServiceDescriptor descriptor ) : System

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

Метод Описание
OnShutdown ( ) : void
OnStart ( string _ ) : void
OnStop ( ) : void

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

Метод Описание
CopyFile ( string sourceFileName, string destFileName ) : void

File replacement.

HandleFileCopies ( ) : void

Process the file copy instructions, so that we can replace files that are always in use while the service runs.

HandleLogfiles ( ) : void

Handle the creation of the logfiles based on the optional logmode setting.

InitLoggers ( winsw.ServiceDescriptor d, bool enableCLILogging ) : void
ReadPassword ( ) : string
SignalShutdownComplete ( ) : void
SignalShutdownPending ( ) : void
StartProcess ( Process processToStart, string arguments, String executable ) : void
StartThread ( ThreadStart main ) : void

Starts a thread that protects the execution with a try/catch block. It appears that in .NET, unhandled exception in any thread causes the app to terminate http://msdn.microsoft.com/en-us/library/ms228965.aspx

StopIt ( ) : void

Called when we are told by Windows SCM to exit.

ThrowNoSuchService ( ) : void
WaitForProcessToExit ( Process processoWait ) : void
printAvailableCommandsInfo ( ) : void
printHelp ( ) : void
printVersion ( ) : void

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

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

public LogEvent ( String message ) : void
message String
Результат void

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

public LogEvent ( String message, EventLogEntryType type ) : void
message String
type EventLogEntryType
Результат void

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

public static Main ( string args ) : int
args string
Результат int

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

protected OnShutdown ( ) : void
Результат void

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

protected OnStart ( string _ ) : void
_ string
Результат void

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

protected OnStop ( ) : void
Результат void

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

Runs the wrapper.
Any unhandled exception
public static Run ( string _args, winsw.ServiceDescriptor descriptor = null ) : void
_args string Arguments. If empty, WinSW will behave in the service mode. Otherwise - CLI mode
descriptor winsw.ServiceDescriptor Service descriptor. If null, it will be initialized within the method. /// In such case configs will be loaded from the XML Configuration File.
Результат void

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

public WrapperService ( ) : System
Результат System

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

public WrapperService ( winsw.ServiceDescriptor descriptor ) : System
descriptor winsw.ServiceDescriptor
Результат System