/[projects]/dao/DaoMqPump2/MQFilter/FilterMainProgram.cs
ViewVC logotype

Annotation of /dao/DaoMqPump2/MQFilter/FilterMainProgram.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2162 - (hide annotations) (download)
Fri May 16 17:57:08 2014 UTC (10 years ago) by torben
File size: 2663 byte(s)
... compiles
1 torben 2160 using System;
2     using System.Collections.Generic;
3     using System.Text;
4    
5 torben 2161 using System.ServiceProcess;
6     using System.Diagnostics;
7    
8     using System.Configuration.Install;
9     using System.Collections.Specialized;
10     using System.Runtime.InteropServices;
11    
12 torben 2162 using DaoCommon;
13 torben 2161
14 torben 2162
15 torben 2160 namespace MQFilter
16     {
17     class FilterMainProgram
18     {
19     static void Main(string[] args)
20     {
21 torben 2161
22     if (args.Length == 1)
23     {
24     if (args[0] == "--debug")
25     {
26     try
27     {
28    
29    
30 torben 2162 FilterController controller = FilterController.getInstance();
31 torben 2161
32     ElapsedTimer timer = new ElapsedTimer();
33     controller.transportAllMessages();
34    
35     timer.stopAndPrint("debug run");
36    
37     }
38     catch (Exception e)
39     {
40     Console.WriteLine("Error: " + e.Message);
41     }
42    
43    
44    
45    
46    
47     Console.WriteLine("Press any key to continue");
48     Console.ReadKey(); //wait for user input
49     }
50     else if (args[0] == "/i" || args[0] == "/u")
51     {
52    
53     bool undo;
54     if (args[0] == "/i")
55     {
56     undo = false;
57     }
58     else
59     {
60     undo = true;
61     }
62     MyServiceInstaller.DoInstall(undo, new string[] { });
63     }
64     else
65     {
66     Console.WriteLine("MQFilter by THN");
67     Console.WriteLine("Options:");
68     Console.WriteLine(" --debug start a single run debug session");
69     Console.WriteLine(" /i install as a service");
70     Console.WriteLine(" /u un-install service");
71     }
72    
73     }
74     else
75     {
76     PumpService service = new PumpService();
77    
78    
79     // now run all the service that we have created.
80     // This doesn't actually cause the services
81     // to run but it registers the services with the
82     // Service Control Manager so that it can
83     // when you start the service the SCM will call
84     // the OnStart method of the service.
85    
86     ServiceBase.Run(service);
87     }
88    
89 torben 2160 }
90 torben 2161
91 torben 2160 }
92     }

  ViewVC Help
Powered by ViewVC 1.1.20