Exemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
     Environment.CurrentDirectory = Path.GetDirectoryName(MainService.IsRunningInMono ? GetExecutablePath() : typeof(Program).Assembly.Location);
     //Install command-line argument
     if (args.Any(a => a.Equals("-install", StringComparison.InvariantCultureIgnoreCase)))
     {
         InstallService(args);
     }
     else if (args.Any(a => a.Equals("-uninstall", StringComparison.InvariantCultureIgnoreCase)))
     {
         UninstallService(args);
     }
     else if (args.Any(a => new[] { "/?", "-?", "/help" }.Any(helpArg => helpArg.Equals(a, StringComparison.InvariantCultureIgnoreCase))))
     {
         ShowUsage();
     }
     else
     {
         var svc = new MainService();
         svc.Run(args);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
     Environment.CurrentDirectory = Path.GetDirectoryName(MainService.IsRunningInMono ? GetExecutablePath() : typeof (Program).Assembly.Location);
     //Install command-line argument
     if (args.Any(a => a.Equals("-install", StringComparison.InvariantCultureIgnoreCase)))
     {
         InstallService(args);
     }
     else if (args.Any(a => a.Equals("-uninstall", StringComparison.InvariantCultureIgnoreCase)))
     {
         UninstallService(args);
     }
     else if (args.Any(a => new[] { "/?", "-?", "/help" }.Any(helpArg => helpArg.Equals(a, StringComparison.InvariantCultureIgnoreCase))))
     {
         ShowUsage();
     }
     else
     {
         var svc = new MainService();
         svc.Run(args);
     }
 }