Ejemplo n.º 1
0
        protected override void OnStart(string[] args)
        {
            var locator = new NinjectServiceLocator(MessengerWindowsService.GetBindingsConfiguration());

            ServiceLocator.SetLocatorProvider(() => locator);

            this.messenger = new MessageService();
            this.messenger.Start();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(params string[] args)
 {
     if (args.Length == 0)
     {
         ServiceBase[] ServicesToRun;
         ServicesToRun = new ServiceBase[]
         {
             new MessengerWindowsService()
         };
         ServiceBase.Run(ServicesToRun);
     }
     else
     {
         var s = new MessengerWindowsService();
         s.Start();
         System.Threading.ManualResetEvent e = new System.Threading.ManualResetEvent(false);
         e.WaitOne();
         Console.ReadKey();
     }
 }