Esempio n. 1
0
 static void Main(string[] args)
 {
     //System.Console.WriteLine(args.Length);
     if (args.Length == 0)
     {
         ServiceBase serviceToRun = new Service();
         ServiceBase.Run(serviceToRun);
     }
     switch (args[0].Trim())
     {
         case "-c":
         {
             System.Console.WriteLine("starting in console mode");
             SendersManager sm = new SendersManager();
             sm.Start();
             /*for (int i = 0; i < 10000; i++ )
                 System.Console.WriteLine(i);
             sm.Stop();*/
             System.Windows.Forms.Application.Run();
         }
         break;
         case "-h":
         default:
         {
             System.Console.WriteLine("-h This help");
             System.Console.WriteLine("-c Run in console");
         }
         break;
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //System.Console.WriteLine(args.Length);
            if (args.Length == 0)
            {
                ServiceBase serviceToRun = new Service();
                ServiceBase.Run(serviceToRun);
            }
            switch (args[0].Trim())
            {
            case "-c":
            {
                System.Console.WriteLine("starting in console mode");
                SendersManager sm = new SendersManager();
                sm.Start();

                /*for (int i = 0; i < 10000; i++ )
                 *  System.Console.WriteLine(i);
                 * sm.Stop();*/
                System.Windows.Forms.Application.Run();
            }
            break;

            case "-h":
            default:
            {
                System.Console.WriteLine("-h This help");
                System.Console.WriteLine("-c Run in console");
            }
            break;
            }
        }
Esempio n. 3
0
 protected override void OnStop()
 {
     try
     {
         _sManager.Stop();
         _sManager = null;
         GC.Collect();
     }
     catch (SystemException)
     {
     }
 }
Esempio n. 4
0
 protected override void OnStop()
 {
     try
     {
         _sManager.Stop();
         _sManager = null;
         GC.Collect();
     }
     catch (SystemException)
     {
     }
 }
Esempio n. 5
0
 protected override void OnStart(string[] args)
 {
     _sManager = new SendersManager();
     _sManager.Start();
 }
Esempio n. 6
0
 protected override void OnStart(string[] args)
 {
     _sManager = new SendersManager();
     _sManager.Start();
 }