12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
-
- using System.ServiceModel;
- using System.ServiceProcess;
- using Foghorn.WcfService;
- namespace Foghorn.WindowsService
- {
- partial class FoghornWindowsService : ServiceBase
- {
- private readonly ServiceHost _wcfServiceHost = new ServiceHost(typeof (FoghornService));
- public FoghornWindowsService()
- {
- InitializeComponent();
- }
- protected override void OnStart(string[] args)
- {
- if (_wcfServiceHost != null) _wcfServiceHost.Open();
- base.OnStart(args);
- }
- protected override void OnStop()
- {
- if (_wcfServiceHost != null) _wcfServiceHost.Close();
- base.OnStop();
- }
- }
- }
|