class Program{static void Main(string[] args){HostFactory.Run(hostConfigurator =>{hostConfigurator.Service<WServ>(serviceConfigurator =>{serviceConfigurator.ConstructUsing(() => new WServ());serviceConfigurator.WhenStarted(myService => myService.Start());serviceConfigurator.WhenStopped(myService => myService.Stop());});hostConfigurator.RunAsLocalSystem();hostConfigurator.SetDisplayName("CAM_WServ");hostConfigurator.SetDescription("WServ using Topshelf");hostConfigurator.SetServiceName("CamWserv");});}}
public class WServ : ServiceCustomCommand
{
// --------------- 8< ------ snip ---------- >8 ------------------------\\
public void CustomCommand(HostControl hostControl, int command)
{
Console.WriteLine("Custom Command - " + command.ToString());
}
}
--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.